i am trying to record a sound(audio signal) and it keeps giving me error's on get audiodata, can you help me identify the problem?

2 visualizaciones (últimos 30 días)
x = (10000, 1);
x(1 : 2000: 10000) = 1;
sound(x)
plot(x);
a = audiorecorder(10000, 8, 1);
record(a, 5);
sound(x)
b = getaudiodata(a, 8)
sound(b);
plot(b)
  3 comentarios
codefanta
codefanta el 15 de En. de 2019
error using audiorecorder/getaudiodata (line 722)
unsupported data type
thats the exact error message, hopefully its helpful
codefanta
codefanta el 15 de En. de 2019
hello
Sorry i should be been more clear before.
The aim is to create 5 audio signals, play the signals and the record the sound so i can analyse the data later
hopefully this clears things

Iniciar sesión para comentar.

Respuesta aceptada

Star Strider
Star Strider el 15 de En. de 2019
If you want to specify that ‘a’ is an int8 data type, try this:
b = getaudiodata(a, 'int8')
  4 comentarios
codefanta
codefanta el 15 de En. de 2019
I still get an error, however I plotted my results and the code works!
Would it be play (b, '8bit' or 'double') ? i am very confused
Star Strider
Star Strider el 15 de En. de 2019
Great!
What is the error?
Also, posting the code you are currently using would help.
Would it be play (b, '8bit' or 'double') ?
It would most likely default to whatever the data type is in ‘a’. You may not need to specify the data type.
It also depends on the function you use. See the documentation section on Play Audio (link) for an extended discussion. It gives examples for both the sound function and the audioplayer play function.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by