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

StandingWave 2 crashes at end of SoundTouchFilter source #1

Open
also opened this issue Jan 31, 2010 · 1 comment
Open

StandingWave 2 crashes at end of SoundTouchFilter source #1

also opened this issue Jan 31, 2010 · 1 comment

Comments

@also
Copy link
Owner

also commented Jan 31, 2010

Using StandingWave's AudioSampleHandler class, when the player reaches the end of the source, SoundTouchFilter returns a Sample with a length less than requested. This results in an exception like:

RangeError: Error #1125: The index 3614 is out of range 3614.
    at com.noteflight.standingwave2.output::AudioSampleHandler/handleSampleData()[/Users/ryan/work/standingwave/main/src/com/noteflight/standingwave2/output/AudioSampleHandler.as:164]
    at com.noteflight.standingwave2.output::AudioPlayer/handleSampleData()[/Users/ryan/work/standingwave/main/src/com/noteflight/standingwave2/output/AudioPlayer.as:112]

In StandingWave, the length of an IAudioSource is provided by the frameCount property. SoundTouchFilter returns Number.MAX_VALUE, as the precise frame count is difficult to calculate, and changes when the filter's parameters are adjusted. As a result, AudioSampleHandler/handleSampleData() does not expect the source to ever end, and does not handle the short final sample.

@also
Copy link
Owner Author

also commented Jan 31, 2010

http://gist.github.com/291245 is a patch for StandingWave 2 that allows it to work with IAudioSources of indeterminate length.

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

1 participant