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

14 ビュー (過去 30 日間)
heri purwantoro
heri purwantoro 2017 年 12 月 17 日
コメント済み: Jan 2017 年 12 月 20 日
I have audio, i use audioread in program. how to convert audio to ASCII code??
  10 件のコメント
Guillaume
Guillaume 2017 年 12 月 19 日
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 2017 年 12 月 20 日
@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.

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2017 年 12 月 17 日
reshape( num2hex(TheSignalArray(:)) .', 1, [])
  5 件のコメント
Walter Roberson
Walter Roberson 2017 年 12 月 19 日
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 2017 年 12 月 19 日
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'

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAudio I/O and Waveform Generation についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by