I have audio, how to convert to ASCII code??

31 visualizaciones (últimos 30 días)
heri purwantoro
heri purwantoro el 17 de Dic. de 2017
Comentada: Jan el 20 de Dic. de 2017
I have audio, i use audioread in program. how to convert audio to ASCII code??
  10 comentarios
Guillaume
Guillaume el 19 de Dic. de 2017
why integer value between 0 until 127?
Because that's the definition of ASCII. It's a 7-bit encoding so the values are from 0 to 2^7-1 == 127.
my purpose convert audio to ascii us[ing] cryptography algorithm
Yes, but what algorithm? Until you tell us the finer details of your algorithm we have no idea how to convert. As I said, there are many ways to convert some sequence of numbers into another sequence of numbers all producing different results.
Jan
Jan el 20 de Dic. de 2017
@heri: If all you want is to encrypt the file, use fileread or fread(fileID, Inf, 'uint8'). You do not have to convert the signal, if you can encrypt the bytes directly.
Your explanations did not help yet to find out, what you want to achieve exactly.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 17 de Dic. de 2017
reshape( num2hex(TheSignalArray(:)) .', 1, [])
  5 comentarios
Walter Roberson
Walter Roberson el 19 de Dic. de 2017
Note that there are two ways you can do "audio encryption":
1) Read the audio file, and calculate an encrypted version of the signal. If the sampling frequency is not fixed, then you will need to either include it "in the clear" or you will need to include it in the information being encrypted. When you use this approach, all extra information such as track names and artist and copyright will be discarded and not transferred. It would be possible for the decrypting side to play the sound immediately after decrypting.
2) Read the audio file as a series of bytes or characters, and calculate an encrypted version of that. The decrypting side would typically need to write the decrypted information into a file and then read the file in order to be able to play the sound after decrypting. All extra information such as track names and artist and copyright will be included, whatever was in the original file.
Walter Roberson
Walter Roberson el 19 de Dic. de 2017
Also, if you are planning to encrypt an audio signal, you should seriously consider using the 'native' option when you read the signal,
[data, fs] = audioread('Concerto For Jar-Jar.mp3', 'native');
This would often return integer data instead of floating point that you would get without 'native'

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Encryption / Cryptography en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by