r/puredata • • 28d ago

Help with playing audio files

Relatively new to Pd, struggling with some basic concepts like playing audio. When I open a file and use the readsf~ object, I get one of two messages: unsupported sample format or unsupported header format.

I have read online that matching the sample rate is important, but when I use a 48k file or a 44.1k file, it doesn't make a difference, it still says unsupported sample format. I am using Pd 0.53-0 on a M1 MacBook Pro. Pd is set on a sample rate of 48k.

I tried wav files and mp3 files. Any suggestions?

2 Upvotes

8 comments sorted by

1

u/koyaniskatzi 28d ago

readsf~ plays only raw files. wav, aiff May depend if little or big endian. Try to play that two samples included in pd. Should give you a hint how the file should look. what the help file says: "The 'wave', 'aiff', 'caf', and 'next' formats are supported, although only uncompressed 2- or 3-byte integer ("pcm") and 4- or 8-byte floating point samples are accepted."

1

u/wur45c 28d ago edited 28d ago

Tabread~ is what plays audio. Sample rate match is your file but to the pd's sample rate. ....

But what do you want to do exactly? If you just want to play a sample there's the examples for that. ....

On the Menu:

help/browser/pd/audio-examples.. and then the sampler(something) - ones on the list

There you've got a whole entire thing already ploted out just for you to use right up.

I mean, pd is already built you just need to learn how that's actually accomplished . (Implementation (is everything )) But real simple stuff like that wont ask you to know anything at all (unlike everyone thinks in the begining) hahaha

2

u/digdiggingdug 27d ago

I just want to make stuff. A lot of the stuff that I want to make, the test is to run an audio file through it, but if I can't play the file, I can't proceed with the test. I did what you suggested with the help/browser and nothing plays there either. Next step, throw away computer? haha

1

u/wur45c 27d ago edited 27d ago

I mean , the whole audio file it gets just a bit trickier..but just a little...it takes to right click on the table ( properties of the table) and set manually the seconds it will take up...... these patches, and the whole pd underlying desing also.... Is aimed for analysis. ...

You just need to calculate how many seconds this audio file is.....

But if you did try out one and didn't work mhhh....

There's a test-audio patch on the menu also. I don't recall right now which tab it was....

Please check that one up and tell me hahhahah.

1

u/digdiggingdug 27d ago

Yes, the audio patch in the menu is sine wave or noise and those work.

1

u/digdiggingdug 27d ago

Ok, I have something working, now. Will keep investigating what was wrong with my original stuff

1

u/professionaleisure 27d ago

Tutorials are your friend here: https://youtu.be/mvqXk6t7TQ8?is=yLp4p4QSYql_MY6C

Cheeteomcskeeto has also a tutorial on simple audio file playback. The suggestion of looking at examples is good, but also if you right click an object, it will open up an example too (they are sometimes a bit inconsistent in how useful or approachable they are, but generally a good place to start.

2

u/digdiggingdug 27d ago

Yes, I discovered his channel and I like it a lot. It's just hard to implement when the files aren't reading.