Guys, Im trying to engineer in python a way of transforming a list of integer values between 0-255 into representative equivalent tones from 1500-2200Hz. Timing information (at 1200Hz) is given by the (-1),(-2) and (-3) values. I have created a function that generates a .wav file and then call this function with the parameters of each tone. I need to create a 'stream' either by concatenating lots of individual tones into one output file or creating some way of running through the entire list and creating a separate file. Or by some other crazy function I don't know of.... The timing information will vary in duration but the information bits (0-255) will all be fixed length.
A sample of the list is shown below:
[-2, 3, 5, 7, 7, 7, 16, 9, 10, 21, 16, -1, 19, 13, 8, 8, 0, 5, 9, 21, 19, 11, -1, 11, 16, 19, 5, 21, 34, 39, 46, 58, 50, -1, 35, 46, 17, 28, 23, 19, 8, 2, 13, 12, -1, 9, 6, 8, 11, 2, 3, 2, 13, 14, 42, -1, 35, 41, 46, 55, 73, 69, 56, 47, 45, 26, -1, -3]
The current solution I'm thinking of involves opening the file, checking the next value in the list using an 'if' statement to check whether the bit is timing (-ve) and if not: run an algorithm to see what freq needs to be generated and add the tone to the output file. Continue until -3 or end of list.
Can anyone guide on how this complete output file might be created or any suggestions... I'm new to programming so please be gentle. Thanks in advance