Comments (6)
I recently changed the default behavior so that decoders are no longer automatically opened when they are created. There is a static method in AudioDecoder that can be used to set whether or not decoders should be automatically opened, or they can be opened by calling Open() directly. I think that your first problem scenario could be resolved by calling Open() before you enqueue the decoder.
I'll have to investigate the second scenario a little bit more.
from sfbaudioengine.
Thanks for the reply. Calling AudioDecoder::SetAutomaticallyOpenDecoders(true);
seems to have fixed both issues for the most part, but I'm still experiencing some (random) playback issues where if I enqueue a decoder and immediately call Play()
, there is no audio and I have to call Play()
a second time.
from sfbaudioengine.
This is not totally unexpected behavior, because if the decoding thread hasn't had time to begin decoding before you call Play() the player will automatically stop itself. This behavior is not ideal, but since I don't want to lock the player for an indeterminate amount of time in Enqueue() it's the compromise I made. One way around this is to add a decoding started callback to your decoder, and call Play() when that callback is invoked. This will ensure that the player will have audio and that it won't stop itself.
from sfbaudioengine.
This does work, but there's a minor problem. The rendering started callback is actually never called unless Play()
is called first. To work around this, I call Play()
immediately after enqueueing, and then I call it again in the renderingStarted callback for good measure. It might be nice to add another callback for when the data has begun decoding and is ready to play, but hasn't actually started playing yet.
EDIT: After further testing, it seems that the issue is still there even with this workaround
from sfbaudioengine.
You need to add a decoding started callback. The decoding started callback is called once the decoding thread begins decoding the audio. It will be called regardless of the player's state after a track has been enqueued.
from sfbaudioengine.
Thanks Stephen, I got mixed up between the rendering and decoding callbacks. This works great, thank you.
from sfbaudioengine.
Related Issues (20)
- 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 3
- 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
- Encoding .wav to .oggOpus HOT 8
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.