Schneiden wir dann nicht auch diese Teile aus dem Wort raus?
Hier mal ein Update von der main
Code:
#include <iostream>
#include <vector>
#include <fstream>
#include <stdio.h>
#include <limits.h>
#include "diaSound.hpp"
bool debug = false;
void analyse(int32_t *waveBuffer)
{
int32_t maximum = waveBuffer[0];
int32_t minimum = waveBuffer[0];
int32_t maxpos, minpos;
int i;
for(i=0;i<SHRT_MAX;i++)
{
if(waveBuffer[i] > maximum)
{
maximum = waveBuffer[i];
maxpos = i + 1;
}
if(waveBuffer[i] < minimum)
{
minimum = waveBuffer[i];
minpos = i + 1;
}
}
}
int main()
{
fstream datei;
int32_t input[SHRT_MAX], waveBuffer[SHRT_MAX];
int i;
uint8_t *wave;
audioCapture(input, SHRT_MAX, "plughw:1,0", 1, 12000, 8);
wave = (uint8_t *) malloc(SHRT_MAX+1);
if(debug) datei.open("test.csv", ios::out);
for(i=0;i<SHRT_MAX;i++)
{
wave[i] = input[i] & 0x00ff;;
waveBuffer[SHRT_MAX] = input[i] & 0x00ff;
if(debug) cout << i << " -> " << input[i] << endl;
if(debug) datei << input[i] << endl;
}
analyse(waveBuffer);
if(debug) datei.close();
playCaptured(wave, SHRT_MAX, "plughw:1,0", 1, 12000, 8);
free(wave);
return 1;
}
Lesezeichen