Playing DSD on iOS #264
Replies: 16 comments 6 replies
-
What do you expect Please read How do I ask a good question and also the documentation (in the headers) for SFBAudioEngine. I believe that the answers you need are there, but without sufficient detail on what you're attempting and a reproducible example it's difficult to know the root cause. Some of the issues you're having seem to be unrelated to SFBAudioEngine at first glance. I also recommend never passing |
Beta Was this translation helpful? Give feedback.
-
It must be related to SFR as it plays without issues with the stk player. But the Sri player can’t play dsd files. This is why I want to use fsb.Neither my friend programmer or myself seem to get fsb to play an url without explicitly telling it the file name and extension. And even then, if it’s a dsd file, it won’t play it.It plays the flac file, but again, I have to tell it the name and extension for it to play. That’s how it is in the sample.Ok, I’ll change the error.Sent from my iPhoneOn Jun 19, 2023, at 6:03 AM, Stephen Booth ***@***.***> wrote:
What do you expect [sfbAudioPlayer playDecoder: (SFBDSDPCMDecoder*) self.urlToPlay error:nil]; to do? What is the anticipated result of casting to an unrelated type?
Please read How do I ask a good question and also the documentation (in the headers) for SFBAudioEngine. I believe that the answers you need are there, but without sufficient detail on what you're attempting and a reproducible example it's difficult to know the root cause. Some of the issues you're having seem to be unrelated to SFBAudioEngine at first glance.
I also recommend never passing nil for errors because they will often illuminate the cause of problems.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
If I am trying to play a dsd file, it seemed like a good idea to use the dsd decoder.Sent from my iPhoneOn Jun 19, 2023, at 9:21 AM, Dorian Mattar ***@***.***> wrote:It must be related to SFR as it plays without issues with the stk player. But the Sri player can’t play dsd files. This is why I want to use fsb.Neither my friend programmer or myself seem to get fsb to play an url without explicitly telling it the file name and extension. And even then, if it’s a dsd file, it won’t play it.It plays the flac file, but again, I have to tell it the name and extension for it to play. That’s how it is in the sample.Ok, I’ll change the error.Sent from my iPhoneOn Jun 19, 2023, at 6:03 AM, Stephen Booth ***@***.***> wrote:
What do you expect [sfbAudioPlayer playDecoder: (SFBDSDPCMDecoder*) self.urlToPlay error:nil]; to do? What is the anticipated result of casting to an unrelated type?
Please read How do I ask a good question and also the documentation (in the headers) for SFBAudioEngine. I believe that the answers you need are there, but without sufficient detail on what you're attempting and a reproducible example it's difficult to know the root cause. Some of the issues you're having seem to be unrelated to SFBAudioEngine at first glance.
I also recommend never passing nil for errors because they will often illuminate the cause of problems.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
In addition to the error message some information that will help narrow things down:
|
Beta Was this translation helpful? Give feedback.
-
The source is audio in the iPhone. The music app as well as my app using stk player are able to play them.I don’t use fopen, I have a media picker.Different types, including AIFF, dsd, mp3, m4a, Ape, flac. First I just want to be able to play the tracks. Then be able to play the best quality possible depending on the output; usb, Bluetooth, airplay, etc.The player that I currently use supports everything except dsd.I’m not sure what is best, I will have to resécate what is better. Do you have a suggestion between DoP or PCM?I just want the best possible audio in the app.Thanks.Sent from my iPhoneOn Jun 19, 2023, at 10:36 AM, Stephen Booth ***@***.***> wrote:
In addition to the error message some information that will help narrow things down:
What is the source of the audio you're trying to play?
Is the URL you're trying to play accessible using fopen or similar from within the app?
What format is the audio?
What device are you using for output?
What formats does it support?
Do you want to play DSD using DoP or converted to PCM?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
For the test, I added a did file to the project and I’m feeding it directly
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"01 - Back In The Saddle” ofType:@"dsf”];
… On Jun 19, 2023, at 10:36 AM, Stephen Booth ***@***.***> wrote:
In addition to the error message some information that will help narrow things down:
What is the source of the audio you're trying to play?
Is the URL you're trying to play accessible using fopen or similar from within the app?
What format is the audio?
What device are you using for output?
What formats does it support?
Do you want to play DSD using DoP or converted to PCM?
—
Reply to this email directly, view it on GitHub <#264 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABLTNEDVG2PJRQE2LYML5RLXMCEYTANCNFSM6AAAAAAZLEZJSM>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
Ok, got this error.
SFB Error: The type of the file “01 - Back In The Saddle.dsf” is not supported.
So what do I need to do to have it play .dsf files?
Thanks!
… On Jun 19, 2023, at 10:36 AM, Stephen Booth ***@***.***> wrote:
In addition to the error message some information that will help narrow things down:
What is the source of the audio you're trying to play?
Is the URL you're trying to play accessible using fopen or similar from within the app?
What format is the audio?
What device are you using for output?
What formats does it support?
Do you want to play DSD using DoP or converted to PCM?
—
Reply to this email directly, view it on GitHub <#264 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABLTNEDVG2PJRQE2LYML5RLXMCEYTANCNFSM6AAAAAAZLEZJSM>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
On the Mac sample, this is used before playing:
/// Returns a decoder for this playlist item or `nil` if the audio type is unknown
func decoder(enableDoP: Bool = false) throws -> PCMDecoding? {
let pathExtension = url.pathExtension.lowercased()
if AudioDecoder.handlesPaths(withExtension: pathExtension) {
return try AudioDecoder(url: url)
} else if DSDDecoder.handlesPaths(withExtension: pathExtension) {
let dsdDecoder = try DSDDecoder(url: url)
return enableDoP ? try DoPDecoder(decoder: dsdDecoder) : try DSDPCMDecoder(decoder: dsdDecoder)
}
return nil
}
So do I need to run this before playing on iOS?
Thanks,
Dorian
… On Jun 19, 2023, at 10:36 AM, Stephen Booth ***@***.***> wrote:
In addition to the error message some information that will help narrow things down:
What is the source of the audio you're trying to play?
Is the URL you're trying to play accessible using fopen or similar from within the app?
What format is the audio?
What device are you using for output?
What formats does it support?
Do you want to play DSD using DoP or converted to PCM?
—
Reply to this email directly, view it on GitHub <#264 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABLTNEDVG2PJRQE2LYML5RLXMCEYTANCNFSM6AAAAAAZLEZJSM>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
The DSDPCMDecoder is in the iOS sample, but it’s not actually implemented.
I have tried making it work, but I can’t. My friend is also trying and will let me know tomorrow if he can get it to work.
But just wondering why they have the code to decode, but don’t actually use it.
It works great in the Mac sample.
But the iOS returns a not supported format for DSD files.
… On Jun 20, 2023, at 5:30 AM, Stephen Booth ***@***.***> wrote:
DSDPCMDecoder
|
Beta Was this translation helpful? Give feedback.
-
I understand that, not asking for a full-fledged player, but a sample on how to use the decoder would save a lot of time.
Anyways, thanks.
… On Jun 21, 2023, at 6:29 AM, Stephen Booth ***@***.***> wrote:
DSDPCMDecoder is definitely available in iOS. SimplePlayer doesn't use it but the intent of the demo is to illustrate use of the framework rather than be a full-fledged player.
—
Reply to this email directly, view it on GitHub <#264 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABLTNEB36XHXWIDJA4IHAQ3XMLZMZANCNFSM6AAAAAAZLEZJSM>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
-
Y D Man!Will try it.Thanks!Sent from my iPhoneOn Jun 21, 2023, at 8:47 AM, Stephen Booth ***@***.***> wrote:
I just pushed 14b9865 which should enable DSD-to-PCM decoding where possible for the iOS version of SImplePlayer.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi, I am only able to play non dsd/dsf files.
```
// TESTING
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"01 - Back In The Saddle"
ofType:@"dsf"];
self.urlToPlay = [NSURL fileURLWithPath:filePath];
NSString *pathExtension = [[_urlToPlay pathExtension] lowercaseString];
[sfbAudioPlayer playURL:_urlToPlay
error: &error];
if ([SFBAudioDecoder handlesPathsWithExtension:pathExtension]) {
NSLog(@"decoder Player %@", _urlToPlay);
[sfbAudioPlayer playURL:_urlToPlay
error: &error];
} else if ([SFBDSDDecoder handlesPathsWithExtension:pathExtension]) {
SFBDSDDecoder *dsdDecoder = [[SFBDSDDecoder alloc] initWithURL:_urlToPlay
error:nil];
[[SFBDSDPCMDecoder alloc] initWithDecoder:dsdDecoder
error:nil];
[sfbAudioPlayer playURL:_urlToPlay
error: &error];
}
```
… On Jun 21, 2023, at 2:33 PM, Dorian Mattar ***@***.***> wrote:
Y D Man!
Will try it.
Thanks!
Sent from my iPhone
> On Jun 21, 2023, at 8:47 AM, Stephen Booth ***@***.***> wrote:
>
>
>
> I just pushed 14b9865 <14b9865> which should enable DSD-to-PCM decoding where possible for the iOS version of SImplePlayer.
>
> —
> Reply to this email directly, view it on GitHub <#264 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABLTNEBGRDWOW2UMUIJJJG3XMMJSNANCNFSM6AAAAAAZLEZJSM>.
> You are receiving this because you authored the thread.
>
|
Beta Was this translation helpful? Give feedback.
-
This screen capture shows that there is an mp3 track in the URL, but the player won’t play it. It only play the test.flac file that is embedded in the app.

… On Jun 22, 2023, at 12:24 PM, Dorian Mattar ***@***.***> wrote:
Hi, I am only able to play non dsd/dsf files.
// TESTING
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"01 - Back In The Saddle"
ofType:@"dsf"];
self.urlToPlay = [NSURL fileURLWithPath:filePath];
NSString *pathExtension = [[_urlToPlay pathExtension] lowercaseString];
[sfbAudioPlayer playURL:_urlToPlay
error: &error];
if ([SFBAudioDecoder handlesPathsWithExtension:pathExtension]) {
NSLog(@"decoder Player %@", _urlToPlay);
[sfbAudioPlayer playURL:_urlToPlay
error: &error];
} else if ([SFBDSDDecoder handlesPathsWithExtension:pathExtension]) {
SFBDSDDecoder *dsdDecoder = [[SFBDSDDecoder alloc] initWithURL:_urlToPlay
error:nil];
[[SFBDSDPCMDecoder alloc] initWithDecoder:dsdDecoder
error:nil];
[sfbAudioPlayer playURL:_urlToPlay
error: &error];
}
> On Jun 21, 2023, at 2:33 PM, Dorian Mattar ***@***.***> wrote:
>
> Y D Man!
>
> Will try it.
>
> Thanks!
>
> Sent from my iPhone
>
>> On Jun 21, 2023, at 8:47 AM, Stephen Booth ***@***.***> wrote:
>>
>>
>>
>> I just pushed 14b9865 <14b9865> which should enable DSD-to-PCM decoding where possible for the iOS version of SImplePlayer.
>>
>> —
>> Reply to this email directly, view it on GitHub <#264 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABLTNEBGRDWOW2UMUIJJJG3XMMJSNANCNFSM6AAAAAAZLEZJSM>.
>> You are receiving this because you authored the thread.
>>
|
Beta Was this translation helpful? Give feedback.
-
I’m not getting errors.

… On Jun 22, 2023, at 7:08 PM, Stephen Booth ***@***.***> wrote:
@doriansgithub <https://github.com/doriansgithub> you haven't provided adequate information to diagnose the cause. "won't play it" is not meaningful from a debugging perspective. What is the error message? What log messages are shown?
—
Reply to this email directly, view it on GitHub <#264 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABLTNEEROQMSN27YSGETXQTXMT3BRANCNFSM6AAAAAAZLEZJSM>.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
I got this now.
error NSError * domain: @"org.sbooth.AudioEngine.AudioDecoder" - code: 2 0x0000000283c95140
… On Jun 22, 2023, at 7:08 PM, Stephen Booth ***@***.***> wrote:
@doriansgithub <https://github.com/doriansgithub> you haven't provided adequate information to diagnose the cause. "won't play it" is not meaningful from a debugging perspective. What is the error message? What log messages are shown?
—
Reply to this email directly, view it on GitHub <#264 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABLTNEEROQMSN27YSGETXQTXMT3BRANCNFSM6AAAAAAZLEZJSM>.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
Hi, I am able to play dsd files now, but my local ipodlibrary files will not play unless I feed the file manually.
This is the code that makes it work.
Now we are working on playing straight from the _urlToPlay.
NSString *pathExtension = [[_urlToPlay pathExtension] lowercaseString];
if ([SFBAudioDecoder handlesPathsWithExtension:pathExtension]) {
//mp3, ma4, aif, flac
NSLog(@"decoder Player %@", _urlToPlay);
[sfbAudioPlayer playURL:_urlToPlay
error: &error];
NSLog(@"sfbAudioPlayer Error %@", error);
} else if ([SFBDSDDecoder handlesPathsWithExtension:pathExtension]) {
//dsd, dsf, flac
SFBDSDDecoder *dsdDecoder = [[SFBDSDDecoder alloc] initWithURL:_urlToPlay
error:&error];
enableDoP = false;
SFBDoPDecoder *objURLdop;
SFBDSDPCMDecoder *objURLpcm;
if (enableDoP) {
NSLog(@"decoderDoP %@", _urlToPlay);
objURLdop = [[SFBDoPDecoder alloc] initWithDecoder:dsdDecoder
error:&error];
NSLog(@"SFBDSDdopDecoder Error %@", error);
} else {
NSLog(@"decoderPCM %@", _urlToPlay);
objURLpcm = [[SFBDSDPCMDecoder alloc] initWithDecoder:dsdDecoder
error:&error];
NSLog(@"SFBDSDpcmDecoder Error %@",error);
}
[sfbAudioPlayer playDecoder:objURLpcm error:&error];
NSLog(@"sfbAudioPlayer enqueueURL Player %@", error);
}
… On Jun 22, 2023, at 7:08 PM, Stephen Booth ***@***.***> wrote:
@doriansgithub <https://github.com/doriansgithub> you haven't provided adequate information to diagnose the cause. "won't play it" is not meaningful from a debugging perspective. What is the error message? What log messages are shown?
—
Reply to this email directly, view it on GitHub <#264 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABLTNEEROQMSN27YSGETXQTXMT3BRANCNFSM6AAAAAAZLEZJSM>.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
Hi there, I need a clue to get this thru.
The sample uses a local file with NSString *filePath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"Flac"], which I am able to play.
But I can't figure out how to get it to play from an array with different file types including dsd, dsf, etc.
My code filters the array and feeds it into this method, at which point the player simply has to play the url.
(void) setLocalSongPlay: (NSArray *) localArray
mediaItem: (MPMediaItem *) item {
self.arrSongs = localArray.mutableCopy;
self.urlToPlay = item.assetURL;
I've tried this but it won't play:
[sfbAudioPlayer playURL:self.urlToPlay error:nil];
I've tried this but it crashes:
[sfbAudioPlayer playDecoder: (SFBDSDPCMDecoder*) self.urlToPlay error:nil];
Any ideas or sample?
Beta Was this translation helpful? Give feedback.
All reactions