Skip to content

d3ssy23/wav2code-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Handy audio Processing scripts for Matlab and C usage

Matlab scripts to convert an amount of samples from a .wav file to raw data file (e.g ,.txt,.dat), then create C file and format the txt data into a double array.

Samples_to_raw

  • Extracting sample values from wav file to raw data file:
  • Input arguments: samples_to_raw(input_file_name, num_samples_to_extract, output_file_name)
  • The output file is automatically created, and saved in current folder.
  • Example input: samples_to_txt("test.wav", 500, "test.txt")
  • The wav file should be located in the same folder as the script.

    --- NOTE ---

    Only even values are valid to be written in the output file, if a odd number is passed as argument the output array will contain the number-1.

Raw_to_C

  • Extracting the raw values and format them into double array variable in C syntax, creating a new output file ready to be used as an extern variable for audio analysis and experiments.
  • Input arguments: raw_to_c(input_file_name, output_file_name)
  • The output file is automatically created,
  • Example input: raw_to_c("test.txt","test.c")
  • Example structure of the output file: double test[500] = { //values };

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages