Coder Social home page Coder Social logo

Comments (11)

pravdomil avatar pravdomil commented on May 25, 2024 1

great thanks!

from audio-webui.

gitmylo avatar gitmylo commented on May 25, 2024

What does it do?

from audio-webui.

pravdomil avatar pravdomil commented on May 25, 2024

try it, it improves the audio quality a lot

from audio-webui.

gitmylo avatar gitmylo commented on May 25, 2024

Looks like it resamples to 44khz, which is higher than models usually output, and it tries to fix some of the imprecision, also looks like it applies stereo, which should sound better.

i can see why you want that, i'll add it to the utils soon.

from audio-webui.

pravdomil avatar pravdomil commented on May 25, 2024

this improves a quality a lot

sample_rate = 44100


def main(prompt):
    pipe = diffusers.AudioLDMPipeline.from_pretrained("cvssp/audioldm-s-full-v2", torch_dtype=torch.float16).to("cuda")

    audio = pipe(prompt, num_inference_steps=10, audio_length_in_s=a.duration).audios[0]
    audio_resampled = librosa.resample(audio, orig_sr=16000, target_sr=sample_rate)
    audio_enhanced = enhance_audio(audio_resampled)

    return audio_enhanced


def enhance_audio(a: numpy.ndarray):
    octave_up = librosa.effects.pitch_shift(a, sr=sample_rate, n_steps=12, res_type="soxr_vhq")
    return a + octave_up

from audio-webui.

gitmylo avatar gitmylo commented on May 25, 2024

I'll try it out, i'll most likely add it in utils though, not directly in audioldm here.

from audio-webui.

pravdomil avatar pravdomil commented on May 25, 2024

put it also into audioldm, it is a must have, otherwise the quality is not good

from audio-webui.

gitmylo avatar gitmylo commented on May 25, 2024

I'm not sure how that code would enhance the audio, instead, it will just give it a higher pitch it seems. I'll test a bit further

from audio-webui.

gitmylo avatar gitmylo commented on May 25, 2024

Maybe that's just something with trying to use it separately.

Nevermind, i think i'm just missing something.

from audio-webui.

gitmylo avatar gitmylo commented on May 25, 2024

Oh yeah, it can definitely sound better, not always though.

Prompt: Chopping carrots on a wooden plank
seed: 2919297160245668629
other options default.

original.mp4
enhanced.mp4

from audio-webui.

pravdomil avatar pravdomil commented on May 25, 2024

that sounds great, much more cleaner

from audio-webui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.