Still unable to use sound function

I asked this question a few days ago and was told to investigate my sound data (wav file). I tried to debug my wav file but still could not find the offending issue. The wav file I'm reading is just a simple file named asa.wav. I can successfully read into a data array using the following: [X,fs]=wavread('asa.wav'); The resulting data array X is 16636 values long, real, and within the range -0.6 and 0.8. So sound(X,fs) should work just fine. Yet I get the following exception thrown:
Error using sound (line 76)
Error: File: audioplayer.m Line: 474 Column: 20
Arguments to IMPORT must either end with ".*" or else specify a fully qualified class name:
"multimedia.internal.audio.device.DeviceInfo" fails this test.
When something weird like this has happened in the past, was usually because I had an offending file somewhere in my path This time, however, I reinstalled Matlab and removed all folders in the path except the original Matlab folders. Still, i.e. get errors when I use sound.m. What could be happening?
One other thing, when I type
>> help sound
I get the command line reply: No help found for sound.m.
Could this be a clue as to what is going on?

5 comentarios

Sean - check the answer at problem with audioplayer which has a near identical question to yours with the resolution to type the following in the Command Window
rehash toolboxcache
restoredefaultpath
savepath
It is puzzling that you do not see any help for sound, but the function is obviously there. Which version of MATLAB are you using?
Sean de Wolski
Sean de Wolski el 3 de Nov. de 2014
Geoff's suggestion will likely fix this. Sean, it's the nuclear hammer approach to what you were trying to do with the path. The problem with what you were trying to do is that all though you deleted all of the bad paths, you may not have added and refreshed all the good ones.
Sean Lineaweaver
Sean Lineaweaver el 3 de Nov. de 2014
The "nuclear hammer" approach worked well. I can now use sound.m and the call 'help sound'.
However my use of the sound function is embedded in a much larger collection of code, and the audioplayer is still throwing an error at me: "The constructor for class 'audioplayer' must return only one output value". This collection of code uses old-school functions like wavread, and sound, but not the audioplayer object. I assume that this issue is different than the one resolved by the hammer. Do you have any guesses?
Sean Lineaweaver
Sean Lineaweaver el 3 de Nov. de 2014
Nevermind. I found the problem with an incorrectly invoked audio player call.
Is there documentation regarding the nuclear hammer? I can think of many instances over the years where this would have come in very handy.
Thanks, Sean
doc restoredefaultpath
doc rehash

Iniciar sesión para comentar.

Respuestas (1)

Sean de Wolski
Sean de Wolski el 3 de Nov. de 2014
Yes in reply to comments, it's probably being used wrong:
[ap,x] = audioplayer
Instead of
ap = audioplayer
Would throw this error because audioplayer is only expected to return one output. For this use the following to stop at the offending line.
dbstop if error
Then fix this call.

Categorías

Más información sobre Audio I/O and Waveform Generation en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 3 de Nov. de 2014

Comentada:

el 4 de Nov. de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by