-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
β Transform bark (30 Mo) output wav to mp3/webm (pydub) #288
Comments
Is there something special with bark's |
I'm unfamiliar with that module but Bark's Output Format is Mono, so perhaps try: I guess it wouldn't hurt to also specify the samplerate (which is 24000). |
Hmmmn yes, thanks, i'm giving it a try and will let you know on this issue π |
Are you perhaps adding a silence as per the longform audio generation notebook? Ran into the same error yesterday when doing that, because np.zeroes produced 64-bit integers (which are like 64-bit wav samples). The error says that audioop only expects wav samples with 1, 2, 3 or 4 bytes per samples which are equivalent to 8, 16, 24 or 32-bit wavs. Inserting a 64-bit silence in the middle messes things up. The solution was to specify dtype 16bit int for the np.zeroes |
Yes, indeed, this is how I'm adding silents. π
Would you share some code snippets β π |
Not the poster above but you would just specify it in np.zeroes like this: |
Yes exactly dtype=np.int16 as an argument to np.zeroes
β¦On Tue, 16. May 2023 at 20:45, C0untFloyd ***@***.***> wrote:
Not the poster above but you would just specify it in np.zeroes like this:
dtype=np.int16
β
Reply to this email directly, view it on GitHub
<#288 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A4HHAVFHMPCERF2RJO4ZWXTXGPDM3ANCNFSM6AAAAAAYAK4Q6U>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Thanks a lot to both of you @C0untFloyd and @dnrico1 , it really did the trick... making it possible to get the wav file into much much smaller files without hearable quality loss β£οΈ # Properly code slience
# https://github.com/suno-ai/bark/issues/288
silence = np.zeros(int(0.25 * SAMPLE_RATE), dtype=np.int16 )
|
... so output wav can be easily previewed on various platforms and easily compressed to mp3/webm suno-ai#288
β About
i'm currently trying to compress a 30 Mo
wav
output, butpydub
is always complaining about "error: Size should be 1, 2, 3 or 4".π£ Steps to reproduce
Below is my code sample (I built the
wav
with bark ) :Then I get the following error message :
The text was updated successfully, but these errors were encountered: