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

Recording stops when playback stops #72

Open
daankets opened this issue Aug 29, 2021 · 1 comment
Open

Recording stops when playback stops #72

daankets opened this issue Aug 29, 2021 · 1 comment

Comments

@daankets
Copy link

daankets commented Aug 29, 2021

Given either a single duplex AudioIO instance, or 2 independent input/output instances
When simultaneously starting both instances
Then the recording stops once the playback stops.

It seems that the streams are somehow tied, and that the playback stream will keep waiting for more playback data instead of resuming the recording. Makes it quite unusable at the moment.

// ASSUME io1 is a playback instance, and io2 is a recording instance:

const mustic = fs.createReadStream(__dirname + "/guitar-2-16-44100.raw", {
	highWaterMark: 16 * 1024,
	emitClose: false
}
music.pipe(io1); // Send music data to playback device
io2.on("data",(data)=>console.log(data.length)); // Log recorded buffers
io1.start(); // Start playback
io2.start(); // Start recording

Effect: recording buffers are logged as long as playback continues. Then, everything stops.

@rhamnett
Copy link

rhamnett commented Apr 4, 2024

@daankets did you ever solve this

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