Comments (9)
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.
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.
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.
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.
from sfbaudioengine.
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.
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.
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.
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.
@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)
- Can't run in physical device HOT 3
- The opus file is seriously distorted, and only one side of the speaker has sound. HOT 3
- When the speex file is playing, only one side of the speaker has sound, and SFBAudioPlayer.totalTime is nil HOT 3
- I keep getting an error when converting to apple native format, like m4a aac HOT 4
- Total frames not calculated for Ogg Speex streams HOT 1
- When encoding to mp3, the bitrate is always 128kbps HOT 5
- LAME encoder settings are confusing HOT 1
- Whatβs the role of SFBFFmpegDecoder HOT 1
- How to set the output sampleRate HOT 1
- OPUS file duration in milliseconds HOT 3
- SFBFLACDecoder - decodeIntoBuffer - not decoding all frames HOT 5
- Add .podspec for Cocoapods
- Looping a decoder region doesn't work HOT 1
- Unable to stream MP3/WAV and possibly other formats HOT 2
- playReturningError failure HOT 6
- How to changed speed
- Importing Package HOT 2
- macOS 14+ dependencies? HOT 6
- Unable to convert some audio formats
- AudioDevice HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sfbaudioengine.