Skip to content

Exporting Audio to a File #36

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

Closed
YoniH opened this issue Aug 15, 2022 · 2 comments
Closed

Exporting Audio to a File #36

YoniH opened this issue Aug 15, 2022 · 2 comments

Comments

@YoniH
Copy link

YoniH commented Aug 15, 2022

In my web application, I need to be able to export audio to a file.
The docs says that AdvancedAudioPlayer "Can be used in a real-time audio processing context, but can not be used for offline processing."
Is there any other way to export processed audio using Superpowered? If not, is there some workaround?

@YoniH YoniH changed the title Exporting Audio Exporting Audio to a File Aug 15, 2022
@YoniH
Copy link
Author

YoniH commented Aug 16, 2022

Actually, that quote from the docs was taken from here, probably an older version of the docs.

Now I see that the latest version of the docs says that offline processing is supported: The AdvancedAudioPlayer can be used in a real-time audio processing context or offline processing.

Actually, I need to be able to export the output of an entire processor that contains more than one player.
Should I be using a standard offline audio context?

Is there some guide or code example for offline processing and exporting to a file?

@gaborszanto
Copy link
Member

Glad you found it! You need to set internalBufferSizeSeconds in the constructor to 0.

That argument represents the number of seconds to buffer internally for playback and cached points. The value 0 enables "offline mode", where the player can not be used for real-time playback, but can process audio in an iteration. If not zero, the AdvancedAudioPlayer can only be used for real-time playback.

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