Mercurial > hg > svapp
comparison audioio/AudioPortAudioTarget.cpp @ 249:7f08a7e35b3c integration_library
m_bufferSize = 2048 in AudioPortAudioTarget.cpp
author | mathieub <mathieu.barthet@eecs.qmul.ac.uk> |
---|---|
date | Mon, 10 Oct 2011 17:31:30 +0100 |
parents | 8aace2d9f1c2 |
children | 0136555495ae |
comparison
equal
deleted
inserted
replaced
241:a99de38af73f | 249:7f08a7e35b3c |
---|---|
47 if (err != paNoError) { | 47 if (err != paNoError) { |
48 std::cerr << "ERROR: AudioPortAudioTarget: Failed to initialize PortAudio: " << Pa_GetErrorText(err) << std::endl; | 48 std::cerr << "ERROR: AudioPortAudioTarget: Failed to initialize PortAudio: " << Pa_GetErrorText(err) << std::endl; |
49 return; | 49 return; |
50 } | 50 } |
51 | 51 |
52 m_bufferSize = 2048; | 52 m_bufferSize = 2048; //1024 (does not change the latency on win); //initial: 2048 |
53 m_sampleRate = 44100; | 53 m_sampleRate = 44100; |
54 if (m_source && (m_source->getSourceSampleRate() != 0)) { | 54 if (m_source && (m_source->getSourceSampleRate() != 0)) { |
55 m_sampleRate = m_source->getSourceSampleRate(); | 55 m_sampleRate = m_source->getSourceSampleRate(); |
56 } | 56 } |
57 | 57 |
58 PaStreamParameters op; | 58 PaStreamParameters op; |
59 op.device = Pa_GetDefaultOutputDevice(); | 59 op.device = Pa_GetDefaultOutputDevice(); |
60 op.channelCount = 2; | 60 op.channelCount = 2; |
61 op.sampleFormat = paFloat32; | 61 op.sampleFormat = paFloat32; |
62 op.suggestedLatency = 1.0; | 62 op.suggestedLatency = 0.2;//1.0; |
63 op.hostApiSpecificStreamInfo = 0; | 63 op.hostApiSpecificStreamInfo = 0; |
64 err = Pa_OpenStream(&m_stream, 0, &op, m_sampleRate, | 64 err = Pa_OpenStream(&m_stream, 0, &op, m_sampleRate, |
65 paFramesPerBufferUnspecified, | 65 paFramesPerBufferUnspecified, |
66 paNoFlag, processStatic, this); | 66 paNoFlag, processStatic, this); |
67 | 67 |