Play low sampling frequency audio in matlab
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a 6467584*1 double array containing audio data. The sampling frequency for the data is 256. When I try to play the audio using the soundsc function it shows the following error :
% Error using sound (line 76) Device Error: Invalid sample rate. Error in soundsc (line 55)
sound(varargin{:});
Is there any function that I can use in MATLAB to play audio?
0 comentarios
Respuestas (1)
Walter Roberson
el 23 de Abr. de 2018
Editada: Walter Roberson
el 23 de Abr. de 2018
The difficulty appears to originate in the portaudio layer; although sound() itself permits as low as 80 Hz, portaudio is not able to open something that low. Exactly what it can handle might depend upon your OS and hardware.
I am running a scan now to see what the lowest rate is that my system can handle. It may take a while.
foo = rand(1,1000);
for r = 80:8000; try sound(foo,r); fprintf('\nOk at %d!\n', r); break; catch ME; if mod(r,100)==0; fprintf('%d...', r); end; end; end
It is past 800 now; I will update when it stops.
... 1000 was the lowest accepted on my system.
You may need to resample your 256 to 1024 to play it.
0 comentarios
Ver también
Categorías
Más información sobre Audio and Video Data en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!