I am working with my sound files as timetables, but I need to convert them back to wav format when I'm done editing/analyzing. I can't convert directly using audiowrite, so I think I need to convert my timetable first?

 Respuesta aceptada

Star Strider
Star Strider el 19 de Feb. de 2021

0 votos

I never did anything similar, so this is simply the approach I’d try first.
Perhaps first timetable2table then table2array, then save the matrix as a .wav file would work.

3 comentarios

Mike Lynch
Mike Lynch el 20 de Feb. de 2021
This does not work. The file created by table2array is of type 'duration'. I am not sure why.
I think I have to extract the data from the file?
>> A = timetable2table(NMP_tt);
>> B = table2array(A);
>> audiowrite('C.wav',B,fs)
Error using audiowrite
The value of 'y' is invalid. Expected input to be one of these types:
uint8, int16, int32, single, double
Instead its type was duration.
Mike Lynch
Mike Lynch el 20 de Feb. de 2021
I think this works:
To write timetable 'B' to wav file 'C.wav'
>> audiowrite('C.wav',B.data,fs)
Star Strider
Star Strider el 20 de Feb. de 2021
The array created by table2array should simply be a numeric array. If it has an associated time vector with it, extract the column or columns that are not duration arrays, then save them.
If saving the timetable directly from the .wav file works, then go with it.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Productos

Etiquetas

Preguntada:

el 19 de Feb. de 2021

Comentada:

el 20 de Feb. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by