Displaying 20 results from an estimated 26 matches for "nblockalign".
2004 Aug 06
4
Framesize for UWB vs. WB encoding
Hi there.
I am having a little trouble understanding the frame sizes chosen
by the codec.
testenc_uwb.c from the speex-1.0 source distribution has a framesize
of 640 hardcoded and makes use of this value exclusively.
However, a mode query on the actual codec returns 320 as a framesize
for this mode.
int tmp;
speex_mode_query(&speex_uwb_mode, SPEEX_MODE_FRAME_SIZE, &tmp);
2001 Mar 14
2
Playing Problems :(
...er with
ov_read. Buffer setting are:
p_oggB->wfx.wFormatTag = WAVE_FORMAT_PCM;
p_oggB->wfx.nChannels = oggstruct.vi->channels;
p_oggB->wfx.nSamplesPerSec = (unsigned long) oggstruct.vi->rate;
p_oggB->wfx.wBitsPerSample = 16;
p_oggB->wfx.nBlockAlign = (oggstruct.vi->channels *
p_oggB->wfx.wBitsPerSample) / 8;
p_oggB->wfx.nAvgBytesPerSec = (unsigned long)
(p_oggB->wfx.nSamplesPerSec * p_oggB->wfx.nBlockAlign);
p_oggB->wfx.cbSize = 0;
Could someone send me source code, how he is playing ogg file, or give me
som...
2004 Aug 06
1
API suggestions
...mply concatenate all the frames
> together. For example, it makes it impossible to recover from corrupted
> streams and seeking becomes complicated. I would suggest doing something
> similar to what Ogg does.
For CBR this works perfectly. The block size in the WAVE file is defined
by the nBlockAlign value in the WAVEFORMATEX header. These blocks are
of a constant size and facilitate seeking. By grouping a number of frames
together the padding loss becomes minimal (or zero).
Example: CBR Quality 4 Stereo yields 309 bits per frame. I group eight
frames into a block and get 8*309 bits = 309 byte...
2001 Aug 26
4
On the "broken" .WAV files issue
...m-audio data. Only
format information common to all waveform-audio data formats is included in this
structure. This structure has been superseded by the WAVEFORMATEX structure.
typedef struct {
WORD wFormatTag;
WORD nChannels;
DWORD nSamplesPerSec;
DWORD nAvgBytesPerSec;
WORD nBlockAlign;
} WAVEFORMAT;
Members
wFormatTag
Format type. The following type is defined:
WAVE_FORMAT_PCM
Waveform-audio data is PCM.
nChannels
Number of channels in the waveform-audio data. Mono data uses one channel and
stereo data uses two channels.
nSamplesPerSec
Sample rate, in sample...
2004 Aug 06
2
API suggestions
Hi there. I made a couple of noted regarding the speex API.
These are not meant be seen as critisism - rather constructive
suggestions.
I like speex a lot, but I would like it even more if some
of the following features were available. ;)
Christian
<p>Comments about the Speex API - from a developer's perspective
-------------------------------------------------------------
***
2005 Jan 05
4
Encoding and decoding problem in speex 1.0.4
...ite.
I am recording sound in the following format:-
m_WaveFormatEx.wFormatTag = WAVE_FORMAT_PCM;
m_WaveFormatEx.nChannels = 1;
m_WaveFormatEx.wBitsPerSample = 8;
m_WaveFormatEx.cbSize = 0;
m_WaveFormatEx.nSamplesPerSec = 8000;
m_WaveFormatEx.nBlockAlign = 1;
m_WaveFormatEx.nAvgBytesPerSec = 8000;
The recording is as follows :-
When the buffer(size = 2000 bytes) gets filled with sound data a
function with the body shown
below is called.
LPWAVEHDR lpHdr = (LPWAVEHDR) lParam;
if(lpHdr->dwBytesRecorded==0 || lpHdr==NULL)...
2009 Jan 20
0
VoIP with wavefrom and speex
...ngth = audio_encode(buffer,Hdr,Hdr->dwBytesRecorded,8);
//...
//Decode again:
save_length = audio_decode(Hdr,buffer,save_length);
Here are the waveform options:
waveform.nChannels = 1;
waveform.wFormatTag = WAVE_FORMAT_PCM;
waveform.wBitsPerSample = 16;
waveform.nSamplesPerSec = 8000;
waveform.nBlockAlign = (waveform.nChannels*waveform.wBitsPerSample)/8;
waveform.nAvgBytesPerSec = waveform.nSamplesPerSec*waveform.nBlockAlign;
waveform.cbSize = 0;
What am I doing wrong? Are there any examples for encoding a waveform pcm stream in realtime (I didn't found any)?
Thanks for your help,
Peter
--...
2016 Jul 11
0
[PATCH] wave_out: fix casts
...sg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2 )
+wave_callback ( HWAVEOUT hWave, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2 )
{
if ( uMsg == WOM_DONE ) {
EnterCriticalSection ( &cs );
@@ -125,7 +125,7 @@ Set_WIN_Params ( FILE_T dummyFile ,
outFormat.nBlockAlign = (outFormat.wBitsPerSample + 7) / 8 * outFormat.nChannels;
outFormat.nAvgBytesPerSec = outFormat.nSamplesPerSec * outFormat.nBlockAlign;
- switch ( waveOutOpen ( &dev, deviceID, &outFormat, (DWORD)wave_callback, 0, CALLBACK_FUNCTION ) )
+ switch ( waveOutOpen ( &dev, deviceID,...
2012 Oct 25
2
WAVE PCM to OPUS and back
...ave header and play.
Doing it i hear only noise in my headphones. So how can i use Opus in
this way? Thanks in advance
WAVEFORMATEX waveform;
waveform.cbSize = 0;
waveform.wFormatTag = WAVE_FORMAT_PCM;
waveform.nChannels = 2;
waveform.wBitsPerSample = 8;
waveform.nSamplesPerSec = 48000;
waveform.nBlockAlign = waveform.nChannels * (waveform.wBitsPerSample >> 3);
waveform.nAvgBytesPerSec = waveform.nSamplesPerSec * waveform.nBlockAlign;
#define BUFSIZE 512
...
case MM_WIM_DATA:
{
WAVEHDR *Hdr = (WAVEHDR *) msg.lParam;
int opusRes;...
2006 Nov 01
1
Integrating speex with VideoNet application: Constant background noise
...called everytime 160 bytes of data is recorded.
Here's what I did in the initialisation (called only once).
m_waveFormatEx.wFormatTag =WAVE_FORMAT_PCM;
m_waveFormatEx.nChannels =1;
m_waveFormatEx.wBitsPerSample =8;
m_waveFormatEx.cbSize =0;
m_waveFormatEx.nSamplesPerSec =
8000;
m_waveFormatEx.nBlockAlign =1;
m_waveFormatEx.nAvgBytesPerSec = 8000;
int quality =8;
speex_bits_init(&bits);
enc_state = speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &quality);
In my recording callback function
LRESULT RecordSound::OnSoundData(WPARAM wParam, LPARAM lPara...
2006 Nov 02
1
Integrating speex with VideoNet application: Constantbackground noise
...me
160 bytes of data is recorded.
Here's what I did in the initialisation
(called only once).
m_waveFormatEx.wFormatTag
=WAVE_FORMAT_PCM;
m_waveFormatEx.nChannels
=1;
m_waveFormatEx.wBitsPerSample =8;
m_waveFormatEx.cbSize
=0;
m_waveFormatEx.nSamplesPerSec = 8000;
m_waveFormatEx.nBlockAlign
=1;
m_waveFormatEx.nAvgBytesPerSec = 8000;
int quality
=8;
speex_bits_init(&bits);
enc_state =
speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(enc_state,
SPEEX_SET_QUALITY, &quality);
In my recording callback
function
LRESULT RecordSound::OnSoundData(WPARAM wPara...
2004 Aug 06
0
@Christian Buchner: speex acm & netmeeting
...contrast pack 8 frames
into a packet which is inacceptable for realtime conversation. Q5
and upwards use 2 frames. All this is defined in codec.c in the
QualityInfo[] table.
The columns given below are
- Bits per Speex frame
- framesize (160 samples in NB mode)
- Speex Frames per Packet (see Wave nBlockAlign)
- effective bitrate in kbit/s
here's an excerpt for the 8kHz Mono modes
43, 160, 8, 2150, // 8000 1 0 !! extremely bad for NM
79, 160, 8, 3950, // 8000 1 1 !! (high latency)
119, 160, 8, 5950, // 8000 1 2
160, 160, 1, 8000, // 8000 1 3 !! Good...
2004 Dec 28
2
Sound distorted after normalized.
...gone through the manual but
not much info on this area.
The following is my setting from sound card using
mm_system sdk.
WAVEFORMATEX *wfx = (WAVEFORMATEX *)input;
wfx->nSamplesPerSec = 8000;
wfx->nChannels = 1;
wfx->wFormatTag = WAVE_FORMAT_PCM;
wfx->wBitsPerSample = 16;
wfx->nBlockAlign = 2;
wfx->nAvgBytesPerSec = 16000;
Thanks in advance,
YueWeng
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
2005 Jan 05
0
Encoding and decoding problem in speex 1.0.4
...t this doesn't look right:
> m_WaveFormatEx.wFormatTag = WAVE_FORMAT_PCM;
> m_WaveFormatEx.nChannels = 1;
> m_WaveFormatEx.wBitsPerSample = 8;
> m_WaveFormatEx.cbSize = 0;
> m_WaveFormatEx.nSamplesPerSec = 8000;
> m_WaveFormatEx.nBlockAlign = 1;
> m_WaveFormatEx.nAvgBytesPerSec = 8000;
>
>
>
You want 16 bits per sample, and 16000 bytes per second...
-SteveK
2006 Oct 30
0
Integrating speex with VideoNet application: Constant background noise
...called everytime 160 bytes of data is recorded.
Here's what I did in the initialisation (called only once).
m_waveFormatEx.wFormatTag =WAVE_FORMAT_PCM;
m_waveFormatEx.nChannels =1;
m_waveFormatEx.wBitsPerSample =8;
m_waveFormatEx.cbSize =0;
m_waveFormatEx.nSamplesPerSec = 8000;
m_waveFormatEx.nBlockAlign =1;
m_waveFormatEx.nAvgBytesPerSec = 8000;
int quality =8;
speex_bits_init(&bits);
enc_state = speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(enc_state, SPEEX_SET_QUALITY, &quality);
In my recording callback function
LRESULT RecordSound::OnSoundData(WPARAM wParam, LPARAM lPara...
2004 Aug 06
2
@Christian Buchner: speex acm & netmeeting
Hi,
I managed to get the codec into netmeeting. Unfortunately it doesn't
properly work. I tried to talk vie net, but only erranous packets are
decoded. Did I possibly register the codec wiht incorrecxt parameters or
is this a problem of the acm codec?
bye,
D A
--- >8 ----
List archives: http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from
2005 Oct 09
0
Fw: problem in encoder/decoder
...sg->m_pBuffer != NULL)
{
delete pMsg->m_pBuffer;
pMsg->m_pBuffer = NULL;
}
pMsg->m_pBuffer = new UCHAR[encoded_bytes];
CopyMemory(pMsg->m_pBuffer,result,encoded_bytes);
pMsg->m_nBufferSize = encoded_bytes;
pMsg->m_nSampleSize = pMsg->m_nBufferSize / 2;//wfx2.nBlockAlign;
delete[] result;
delete[] output_frame ;
delete[] input_frame;
result = NULL;
input_frame = NULL;
output_frame = NULL;
return TRUE;
}
2006 Sep 08
2
problem with compression and decompression
...put);
/*Copy from float to short (16 bits) for output*/
for (i = 0; i < BUFFERSIZE; i++)
out[i] = output[i];
strcpy(pDecomData, out);
}
main.cpp
while (!_kbhit() )
{
if ( g_oCapture.CaptureSamples(g_ArrBuffer, (BUFFERSIZE /
g_sWaveHeader.wfex.nBlockAlign)
) )
{
int iFrameSize = 0;
char cComFrame[200];
ALchar ArrTemp[BUFFERSIZE];
g_oCapture.Compress(g_ArrBuffer, &iFrameSize, cComFrame
);
g_oCapture.Decompress(ArrTemp, iFrameSize, cComFrame);
g_...
2006 Nov 05
1
Integrating speex with VideoNet application: Constantbackground noise
...0 bytes of data is recorded.
Here's what I did in the
initialisation (called only once).
m_waveFormatEx.wFormatTag
=WAVE_FORMAT_PCM;
m_waveFormatEx.nChannels
=1;
m_waveFormatEx.wBitsPerSample =8;
m_waveFormatEx.cbSize
=0;
m_waveFormatEx.nSamplesPerSec = 8000;
m_waveFormatEx.nBlockAlign
=1;
m_waveFormatEx.nAvgBytesPerSec = 8000;
int quality
=8;
speex_bits_init(&bits);
enc_state =
speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(enc_state,
SPEEX_SET_QUALITY, &quality);
In my recording callback
function
LRESULT RecordSound::OnSoundData(WP...
2006 Dec 24
1
Integrating speex with VideoNet application: Constantbackground noise
...0 bytes of data is recorded.
Here's what I did in the
initialisation (called only once).
m_waveFormatEx.wFormatTag
=WAVE_FORMAT_PCM;
m_waveFormatEx.nChannels
=1;
m_waveFormatEx.wBitsPerSample =8;
m_waveFormatEx.cbSize
=0;
m_waveFormatEx.nSamplesPerSec = 8000;
m_waveFormatEx.nBlockAlign
=1;
m_waveFormatEx.nAvgBytesPerSec = 8000;
int quality
=8;
speex_bits_init(&bits);
enc_state =
speex_encoder_init(&speex_nb_mode);
speex_encoder_ctl(enc_state,
SPEEX_SET_QUALITY, &quality);
In my recording callback
function
LRESULT RecordSound::OnSoundData(WP...