Giter VIP home page Giter VIP logo

Comments (6)

psobot avatar psobot commented on May 12, 2024

Hi @RickyWang111!

When opening an issue, it's much more useful to include context - what you were doing when the error occurred, what your code looks like, and so on.

This error is thrown when attempting to write audio to a file (with pedalboard.io.AudioFile). Data being passed to .write() is expected to be either a one-dimensional array (i.e.: of shape (num_samples,)) or a two-dimensional array (of shape (num_channels, num_samples) or (num_samples, num_channels)).

This error indicates that either you're passing in multi-channel audio when the audio file was opened with num_channels=1 (the default), or you're passing an unexpected shape of data that doesn't look like one of the shapes above. I'll make this error message clearer in a future release.

tl;dr: try setting num_channels=2 when you open the audio file.

from pedalboard.

RickyWang111 avatar RickyWang111 commented on May 12, 2024

I just copied the first example "quick start" and ran it, and then such an error occurred.

from pedalboard import Pedalboard, Chorus, Reverb
from pedalboard.io import AudioFile

with AudioFile('demo.mp3', 'r') as f:
    audio = f.read(f.frames)
    samplerate = f.samplerate


board = Pedalboard([Chorus(), Reverb(room_size=0.25)])
effected = board(audio, samplerate)


with AudioFile('processed-output.wav', 'w', samplerate) as f:
    f.write(effected)

Traceback (most recent call last):
File "G:\work\jy_music2\s1.py", line 18, in
f.write(effected)
RuntimeError: Unable to determine shape of audio input! Expected 1-channel audio.

Could you tell me where is the Full documentation,I can't find anywhere. I am a novice.thank you!

from pedalboard.

RickyWang111 avatar RickyWang111 commented on May 12, 2024

My file 'demo.mp3'. It is a correct file, dual channel, playing without any problem.

from pedalboard.

RickyWang111 avatar RickyWang111 commented on May 12, 2024

and my python is 3.10.2

from pedalboard.

psobot avatar psobot commented on May 12, 2024

Thanks for the context - it seems that the example code in the readme assumed that the input audio was mono. I've just updated the example to explicitly handle stereo audio files, but I'll also leave this bug open to make this more intuitive.

from pedalboard.

RickyWang111 avatar RickyWang111 commented on May 12, 2024

Thank you very much. I can run it now

from pedalboard.

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.