Skip to content
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

Keep allocate memory after reach EOF of mp3 file #1

Closed
gregwym opened this issue Jul 6, 2012 · 4 comments
Closed

Keep allocate memory after reach EOF of mp3 file #1

gregwym opened this issue Jul 6, 2012 · 4 comments

Comments

@gregwym
Copy link

gregwym commented Jul 6, 2012

I'm trying to use this class to play mp3 files from internet.

When the AudioStream reaches EOF of the mp3 file, and turns it state to kFsAudioStreamStopped, but it won't actually stop.
The audioPlaybackRunloop keep allocate new memory for nothing, unless an explicite [AudioController stop] is called.

On simulator, the App eat up 3G of memory until the memory is filled.


It looks like this streamer lib is not designed for play single audio file, but a .pls playlist. Are you willing to improve it to a more generalized form?

Thanks a lot for this awesome lib. Good work.

@muhku
Copy link
Owner

muhku commented Jul 7, 2012

Thanks for the nice analysis.

You are correct that the emphasis on FreeStreamer has been on playing continuous streams, not individual audio files. But certainly streaming an audio file is something that should be supported as a basic use case.

As a fix, we need to make sure that the audioPlaybackRunloop terminates whenever the stream has reached an EOF.

I will try to implement this, though currently I am on my summer vacation, and will be traveling quite heavily, so I have few time for programming work. If you have time to take a look as well, patches are welcome :-)

@gregwym
Copy link
Author

gregwym commented Jul 7, 2012

I'm afraid that I'm not familiar with the Audio API.
Will try if I have a spare.

I'm currently using Alex's AudioStreamer which is more appropriate for my usage.

@muhku
Copy link
Owner

muhku commented Jul 7, 2012

I in fact attempted to fix the issue in the latest commits in the master branch. The most important is commit e14e565 where the audio playback thread is exited when the audio stream has stopped.

I hope this helps with the memory usage.

@muhku
Copy link
Owner

muhku commented Jul 7, 2012

Okay, I think the problem is now fixed. Please do reopen this issue if this is still a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants