-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The audioFileReader object is not responding, causing it to be unable to play #1072
Comments
My application scenario is a. NET WPF desktop application, and the Naudio version is the latest version. The testing scenario is my open source music project MoZhiMusic |
Hmm, that is very strange. Under the hood it is using Media Foundation. But this has generally been very reliable over the years, so not sure what exactly might be causing the problem. Have you tried repositioning with Position instead and see if that exhibits the same issue? |
I have made changes to the code based on your suggestions and used the 'Position' attribute to track the progress of audio playback. However, this issue remains the same as before, especially when playing audio in FLAC format, setting the audio playback position may cause the 'audioFileReader' object to not respond. This is the code I updated: In this annotated code snippet, I integrated the FFPEG extension of CsCore Use NAudio to play FLAC format audio. And add my FFPmpegAudioReaderClass to initialize FLAC format audio and use my MediaElement_ Song class for playback and other operations. The FFmpeg extension of CsCore is working properly and can seamlessly integrate with NAudio's "audioFileReader" and equalizer. NAudio is an important component of mine because it has many functions that I rely on. Combining the FFmpeg extension of CsCore with NAudio can help solve common FLAC playback and equalizer settings issues I encounter when implementing with NAudio. |
perhaps my discussion #1130 is related to this issue? |
After my personal verification, NAudio can indeed be used with ffmpeng to support all formats that ffmpeng can support (such as flac). You can refer to my code, but I'm not sure if Naudio plans to support ffmpeng |
When playing FLAC lossless and higher-quality audio formats, setting the playback progress of a song using audioFileReader.CurrentTime = newTime; has a very high chance of causing the audioFileReader object to become unresponsive.
When there is an issue with "audioFileReader.CurrentTime = newTime;" in the code, the Debug debugger does not allow debugging of any code after "audioFileReader.CurrentTime = newTime;." Instead, it simply skips all subsequent code within the function containing this line and exits, without providing any error messages.
Please note that at this point, you cannot use Dispose() to release memory for the audioFileReader; the only way to release memory is by setting it to null. If "audioFileReader.CurrentTime = newTime;" is executed on the UI thread, the UI interface will freeze, rendering it unresponsive to user interactions.
The text was updated successfully, but these errors were encountered: