0

I had a program like this:

def sig_input(audio):
    fs, data = read(audio)

    print(len(data))

sig_input('audio_file.wav')

But here I have a problem. My audio file is not in the same folder. I grouped my audio files in one folder.

Project Folder
  | audio_folder
        | audio_file.wav
        | ...
  | main.py

My question is how do I access these audio files to main.py file?

1 Answer 1

1

You could try using this code:

def sig_input(audio):
    fs, data = read(audio)

    print(len(data))

sig_input('audio_folder/audio_file.wav')
Sign up to request clarification or add additional context in comments.

1 Comment

Yes, it works. I have tried code like this, but it doesn't work because I wrote it wrong. I wrote it like this: sig_input('/audio_folder/audio_file.wav'). Thank you for the answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.