Csound Android, cannot load wav files

I’m trying to figure out how to get Csound to recognize wav files via the diskin command. A tutorial that uses a wav, which was included, won’t find it. It is in the same folder as the .csd file. I have tried copying it to the Root folder, no luck. I have tried modifying the csd to included the full path to the wav, no luck. I have tried modifying the Settings “Sample folder” option. Still no luck.

I’m using Csound 6.15 on Android 7.

Here is part of the file: //input parameters
Sound = “fox.wav”
iStart = p4 ;position in sec to read the sound
iSpeed = p5
iVolume = -3 ;dB
iPan = .5 ;0=left, 1=right
//perform
aSound = diskin:a(Sound,iSpeed,iStart,1)
aOut = linen:a(aSound,p3/2,p3,p3/2)

I just get error messages. I can output wav files with no problem using
-o/sdcard/name.wav

Thank you for reading.

Are you referring to the Csound Android app, or an app you are building yourself? If you are building the app yourself, you can grab the sample file on the app side (Data and file storage overview  |  Android Developers) and then pass the sample data to a function table using one of the API table methods. This is what I usually do, then I don’t need to bother getting the right file location.

Hi Rory, thank you for your reply. I’m referring to using the Android app. I’m primarily a musician, you know, the starving type. I’m very familiar with general music apps, not programming, although have used computers since DOS so no stranger to command line operations. I’m finding Csound fascinating and see the applications it offers in sound design and performance, but it’s initially a bit of a learning curve for me.

I see, in that case I can’t help :frowning: The Csound Android app is a third party app that is not part of the main Csound package. Perhaps you can reach out to the author and ask them directly if this is possible?

Problem solved. Getting the correct syntax (is that the correct word?) concerning directories was my issue, some other programs use different path descriptions like “internalstorage” or “sdcard”. For any Android users who may have the same problem there are 3 solutions I found:

  1. modify the .csd file, for example:

Sound = “/storage/emulated/0/xxxxxxx/fox.wav”

where xxxxxxx is the folder/directory with the audio file

  1. add the line “/storage/emulated/0/xxxxxxx/” to Settings - Sample directory

  2. add the line “/storage/emulated/0/xxxxxxx/” to Settings - Include directory

Obviously the latter 2 options being the best so you don’t have to modify every .csd that you with to load a sample into.

Thanks again for the reply though, I do appreciate it and will likely be back with more questions !

1 Like