ptwz / python_wizard

Command line LPC analysis tool to generate bitstreams for the Texas Instruments TMS5220 chip
MIT License
40 stars 12 forks source link

Distorted sounds at the end #7

Closed Yury-MonZon closed 5 years ago

Yury-MonZon commented 6 years ago

I'm using it to generate my own sound files, but after I play it via arduino and Talkie library the sound if grabled at the end. What am I doing wrong?

Thanks a lot!

./python_wizard -V -p temp.wav -f arduino /home/osboxes/.local/lib/python2.7/site-packages/numpy/lib/function_base.py:3183: RuntimeWarning: invalid value encountered in true_divide c /= stddev[:, None] /home/osboxes/.local/lib/python2.7/site-packages/numpy/lib/function_base.py:3184: RuntimeWarning: invalid value encountered in true_divide c /= stddev[None, :] const unsigned char temp[] PROGMEM = {0x00,0x00,0x04,0x78,0x36,0x5D,0x01,0x57,0x1B,0xA7,0xA0,0x52,0xD5,0xBC,0x9E,0xD4,0x82,0xC2,0x45,0xE3,0x7A,0x76,0x08,0xBC,0xB4,0xDC,0x95,0xD8,0x21,0xD0,0xCA,0xEB,0x86,0x62,0x8B,0x90,0xBA,0xEA,0x71,0x8C,0x85,0x12,0xAE,0xAB,0x3A,0xD5,0x92,0xF1,0xAA,0x10,0xF5,0xAA,0xDA,0xCD,0x6F,0x4C,0x25,0x26,0x67,0x2F,0x7F,0x48,0x13,0xAB,0x58,0x34,0x82,0x26,0xCD,0x3C,0xF2,0x71,0x0B,0x4B,0x70,0x67,0xEF,0xC9,0x2B,0xCC,0x31,0x5C,0xB3,0xE7,0xAC,0x30,0x87,0x34,0xEB,0x5A,0xBC,0x82,0xEC,0xCB,0xAD,0x7A,0x76,0x09,0x52,0x48,0xD3,0xEA,0xD0,0x24,0xF2,0x3E,0xD5,0xB3,0x48,0x03,0x08,0x60,0xCB,0x0C,0x13,0x04,0xD2,0x65,0xEE,0x8B,0x5D,0xA4,0xF5,0x16,0x5B,0x3C,0x32,0xB1,0xD4,0x5B,0x6C,0xFE,0xCA,0xC4,0x42,0xDD,0x98,0xF2,0x67,0x13,0x0B,0x75,0x6B,0xCA,0x9F,0x5D,0xAC,0xE4,0x8E,0x29,0x7F,0x0E,0xB1,0xD5,0x53,0xAC,0xF6,0x30,0x24,0x36,0x74,0x90,0xE5,0x2D,0x97,0xF9,0x1C,0xCA,0x99,0x75,0x43,0x1E,0x8B,0xA9,0xB4,0x35,0x2D,0x79,0x74,0xE9,0x3C,0xD6,0xB4,0xE4,0x59,0x55,0xF2,0x58,0x9B,0x92,0x67,0x55,0xC1,0x6B,0x8B,0x53,0x91,0x4D,0xBA,0x8E,0xCE,0x74,0x65,0x72,0x61,0xD6,0x5A,0x92,0x55,0xC1,0x9A,0x6A,0x49,0x48,0x64,0x70,0x63,0x16,0xEE,0xB1,0x00,0x00,0x00,0x00};

Adding 0xFF at the end sometimes helps, but not with every sample. I guess, this is encoding issue?

deladriere commented 6 years ago

You need to use the stop command

-S, --includeExplicitStopFrame Create explicit stop frame (needed e.g. for Talkie)

Yury-MonZon commented 6 years ago

Thanks a lot! It is better now, but I still do have the same error and I hear a loud pop at the end of the sample. I'm using this line: ./python_wizard -V -S file.wav -f arduino

ptwz commented 5 years ago

Sorry it took so long to answer. This is most likely due to the fact, the PWM has an idle level of ~50%. So maybe your code does not idle the PWM correctly, leading to a drop from 50% to 0% at the end. Most likely no bug in the conversion but in playback.