Skip to content

StandingWave 2 crashes at end of SoundTouchFilter source #1

@also

Description

@also

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions