Giter Site home page Giter Site logo

Comments (9)

pzs7602 avatar pzs7602 commented on May 20, 2024 1

I modify the codes in AudioPlayer.cpp for using DoPDecoder when playing .dsf audio file:

bool SFB::Audio::Player::Play(CFURLRef url)
{
    if(nullptr == url)
        return false;

//  auto decoder = Decoder::CreateForURL(url);
    SFB::CFString extension = CFURLCopyPathExtension(url);
    Decoder::unique_ptr decoder;
    if(kCFCompareEqualTo == CFStringCompare(extension, CFSTR("dsf"), kCFCompareCaseInsensitive)){
        std::cout << "dsf decoder";
        decoder = DoPDecoder::CreateForURL(url);
    }
    else if(kCFCompareEqualTo == CFStringCompare(extension, CFSTR("ape"), kCFCompareCaseInsensitive)){
        decoder = MonkeysAudioDecoder::CreateDecoder(InputSource::CreateForURL(url));
    }
    else{
        decoder = Decoder::CreateForURL(url);
    }
    return Play(decoder);
}

I connect my iPhone to Sony PHA-3 DAC through a lightning to micro-USB connector, when playing a dsf audio, the DSD indicator in PHA-3 not turn light which means no DoP data sent to PHA-3.
am I missing something in code?

from sfbaudioengine.

sbooth avatar sbooth commented on May 20, 2024

ASIO output only works with certain exaSound DACs and requires special drivers. You should be able to use a DoPDecoder with the standard core audio output as long as the equalizer is flat.

from sfbaudioengine.

sbooth avatar sbooth commented on May 20, 2024

I don't see a problem with your code. Is it possible the iPhone output isn't bit perfect? Can you try on a desktop Mac to see if it works properly?

from sfbaudioengine.

pzs7602 avatar pzs7602 commented on May 20, 2024

I use SFBAudioEngine.xcodeproj to build a Mac desktop app, and then play a dsf audio, I 've set the audio output of my mac book pro to Sony PHA-3 connected to it via USB, but no sound an be heard. But when play mp3/aiff/aac .... , I can enjoy the music.
2015-06-05 20 02 16

from sfbaudioengine.

sbooth avatar sbooth commented on May 20, 2024

It looks like sample rate conversion is being performed from 176.4 to 44.1 which would explain why DoP isn't working correctly because the bit pattern would be altered. Please try setting the DAC's sample rate to match the DSF file's sample rate.

from sfbaudioengine.

pzs7602 avatar pzs7602 commented on May 20, 2024

My DAC is not able to change the sample rate, is it possible to modify the SFBAudioEngine to remain the DSD audio file's format(include sale rate) when playing dsf audio in DoP mode(say, for 2.8224Mhz DSD , when wrapped as DoP to PCM, is 176400Hz )?

from sfbaudioengine.

sbooth avatar sbooth commented on May 20, 2024

SFBAudioEngine attempts to do this (see the log message about the input sample rate and decoder format) but the output sample rate normally comes from the device via core audio. If your device doesn't support sample rate changes (by using SetDeviceSampleRate() in AudioOutput) you could try setting the output audio unit's kAudioUnitProperty_SampleRate on the scope kAudioUnitScope_Output within CoreAudioOutput.

from sfbaudioengine.

pzs7602 avatar pzs7602 commented on May 20, 2024

solve the problem by :

AVAudioSession *session=[AVAudioSession sharedInstance]; // get audio session
[session setPreferredSampleRate:176400 error:&err]; // request 176400 Hz

this set the preferred sample rate of input and output device to 176400
thanks!

from sfbaudioengine.

eximpression avatar eximpression commented on May 20, 2024

@pzs7602 you run you code on osx but as I know AVAduioSession seem only available on the iOS? how did [session setPreferredSampleRate:176400 error:&err] work?

from sfbaudioengine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.