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

PlaybackState Error #1

Open
pluto6322 opened this issue May 27, 2022 · 2 comments
Open

PlaybackState Error #1

pluto6322 opened this issue May 27, 2022 · 2 comments

Comments

@pluto6322
Copy link

When using VarispeedSample Providerd, PlaybackState is always playing , It doesn't change when MP3 playback ends..

thanks for viewing

@markheath
Copy link
Contributor

Some providers always provide the full amount of audio requested in Read, regardless of whether the source stream has reached the end or not. In that case the audio will play forever and you need an alternative mechanism to detect that you have reached the end of the file.

@VRCWizard
Copy link

VRCWizard commented Mar 17, 2023

I wish a solution was provided here. x_x ... i figured out that varispeed was causing "MemoryAllocationError calling waveOutWrite" when spammed because it is always playing.

edit: instead of checking playbackstate for stopped you can get the TotalTime.TotalMilliseconds of the wavefilereader or whatever you are passing into the varispeedSampleProvider. You can then sleep until that time has passed then dispose of everything.

(if you slow down the audio by .5 it would take twice as long to complete so you would have to multiply the time you sleep by 2.)

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

3 participants