Is it possible to change the sample rate of the audio output in flite tts? The default output is 16 kHz PCM and I'd like to change it to output 8 kHz.
There is a function that will do this:
void cst_wave_resample(cst_wave *w, int sample_rate);
Related
I am currently looking at TMP107 sensor. To read temperature, firstly 2 bytes are transmitted and after 1.5 baud, temperature value is received. I can not calculate baud rate. (I have used 115200 baud for UART)
edit: I uploaded read operation of sensor.
I was able to recorded an audio signal through the MIC and i applied FFT and Hanning window function to it. Now I want to know how do I identify CUTOFF frequency from it to apply the High Pass Filter.
my sample rate = 8000 Hz, FFT block size = 256
Can anyone help me to identify this ? I would really appreciate it ! :)
Thanks!
I'm currently using python 3.3 in combination with pyaudio and numpy. I took the example from the pyaudio website to play a simple wave file and send that data onto the default sound card.
Now I would like to change the volume of the audio, but when I multiply the array by 0.5, I get a lot of noise and distortion.
Here is a code sample:
while data != '':
decodeddata = numpy.fromstring(data, numpy.int16)
newdata = (decodeddata * 0.5).astype(numpy.int16)
stream.write(newdata.tostring())
data = wf.readframes(CHUNK)
How should I handle multiplication or division on this array without ruining the waveform?
Thanks,
It seemed that the source file's bitrate (24 bit) was not compatible with portaudio. After exporting to a 16 bit pcm file, the multiplication did not result in distortion.
To fix this for different typed files, it is necessary to check the bit depth and rescale correspondingly.
My code does not work with the phone recorded videos ( MP4 ) .
Have tested other videos mp4 and it works normally.
Does he not support the video phone ?
Video Features :
Format : MPEG - 4
Format profile: Base Media
Codec ID : isom
File size: 29.8 MiB
Duration : 21mn 2s
Overall bit rate: 198 Kbps
Writing application : Lavf52.84.0
Video
ID: 1
Format : MPEG - 4 Visual
Format profile: Simple # L1
Format settings , BVOP : No
Format settings , QPEL On
Format settings , GMC : No warppoints
Format settings , Matrix : Default ( H.263 )
Codec ID: 20
Duration : 21mn 2s
Bit rate: 97.5 Kbps
Width : 176 pixels
Height : 144 pixels
Display aspect ratio : 1.222
Frame rate mode: Constant
Frame rate: 29.970 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type: Progressive
Compression mode: Lossy
Bits / ( Pixel * Frame) : 0.128
Stream size: 14.7 MiB ( 49 % )
Writing library : Lavc52.97.0
audio
ID: 2
Format : MPEG Audio
Format version: Version 1
Format profile: Layer 3
Mode: Joint stereo
Mode extension: MS Stereo
Codec ID: 6B
Duration : 21mn 2s
Bit rate mode: Constant
Bit rate: 96.0 Kbps
Channel ( s ) : 2 channels
Sampling rate: 44.1 KHz
Compression mode: Lossy
Stream size: 14.4 MiB ( 48 % )
Writing library : LAME3.98.4
Your video format is MPEG-4 Visual, which chrome doesn't support.
http://code.google.com/p/chromium/issues/detail?id=54036
It's confusing, but that's not the same as a more standard MP4 file which uses the h.264 codec. Your info should look something like this:
General
Complete name : filename.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
...
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline#L3.0
Format settings, CABAC : No
Format settings, ReFrames : 2 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
...
Try using something like HandBrake or Zencoder to transcode the video.
I am working on UART with pic32mx5xx. All I need is to send a message from pic to terminal (Putty), but it is not working as I would get invalid characters appearing. The baud rate is set to 19200, how do I calculate the clock frequency?
Is it true that the clock frequency of the UART is 16 times the baud rate. If I do the math the clock frequency should be 307200, but this is doesn't seem right.
Can someone help me understand how baud rate and clock frequency relate to each other ? Also how to calculate both?
Thanks!
The baud rate generator has a free-running 16-bit timer. To get the desired baud rate, you must configure its period register UxBRG and prescaler BRGH.
When BRGH is set to 0 (default), the timer is incremented every 16th cycle of peripheral bus clock.
When BRGH is 1, the timer increments every 4th cycle.
It is usually better to set BRGH to 1 to get a smaller baud rate error, as long as the UxBRG value doesn't grow too large to fit into the 16-bit register (on slower baud rates).
The value in the period register UxBRG determines the duration of one pulse on the data line in baud rate generator's timer increments.
See the formulas in section 21.3 - UART Baud Rate Generator in the reference manual to learn how to calculate a proper value for UxBRG.
To compute the period of the 16-bit baud rate generator timer to achieve the desired baud rate:
When BRGH = 0:
UxBRG = FPB / (16 * BAUDRATE) - 1
When BRGH = 1:
UxBRG = FPB / (4 * BAUDRATE) - 1
Where FPB is the peripheral bus clock frequency.
For example, if FPB = 20 MHz and BRGH = 1 and the desired baud rate 19200, you would calculate:
UxBRG = 20000000 / (4 * 19200) - 1
= 259
If you are using some of the latest development libraries and code examples from Microchip you may find that there are already UART methods in the libraries that will set up the PIC for your needs. If you dig deep into the new compiler directory structures you will find help files in the microsoft format (no fear, if you are on a Unix type computer there are Unix utilities that read these types of files.). There you can drill down into the help to find the documentation of various ready made methods you can call from your program to configure the PIC's hardware. Buyer Beware, the code is not that mature. For instance I was working on a PIC project that needed to sample two analog signals. The PIC hardware A/D converter was very complex. But it was clear the ready made code only covered about 10% of that PIC's abilities.
-good luck