Skip to content

Replaying sounds #26

@garakatsamol

Description

@garakatsamol

HI, thanx for your work.
I am trying to record something with a backgrounf music. So i have succesfully implemented a player where i have two sources. The one is loading from an mp3 and the other is the recorder data.

I make a sequence and an audio performerfor each of my sources and then i use both audio performers as sources and i add them to a new sequence. (that is because i want to control in realtime the gain of each performer.). The outcome is assign to an audioplayer

This works fine until i replay the sound. At this case the recorded sound seems to play in fast forward and at the end of the recording sound throws an error

Error: Sample pointer out of range.
at com.noteflight.standingwave3.elements::Sample/getSamplePointer()

Before i replay the sound i try to ensure that audioplayer is stopped

player.stop()

reset the audio performer

_aPerformer.resetPosition()

I get the microphone data with

WaveFile.createSample(recorder.output)

And before i replay it (not really sure if this has a point) i set the position of the recorded data byteArray to 0

recorder.output.position=0

I would appreciate any help.
Thanx in advance!

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