Skip to content
Snippets Groups Projects
Commit 37a9bdbe authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

Merge branch 'recording' of git+ssh://repos-sflphone-git@sflphone.org/~/sflphone into recording

parents 53bdc99a 939a487e
No related branches found
No related tags found
No related merge requests found
...@@ -718,8 +718,7 @@ create_recording_settings () ...@@ -718,8 +718,7 @@ create_recording_settings ()
// folder chooser button // folder chooser button
folderChooser = gtk_file_chooser_button_new(_("Select a folder"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER); folderChooser = gtk_file_chooser_button_new(_("Select a folder"), GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( folderChooser) , gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER( folderChooser), dftPath);
(strcmp(dftPath,"")==0)?g_get_home_dir():dftPath);
gtk_table_attach(GTK_TABLE(table), folderChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5); gtk_table_attach(GTK_TABLE(table), folderChooser, 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 5);
g_signal_connect( G_OBJECT( folderChooser ) , "selection_changed" , G_CALLBACK( record_path_changed ) , NULL ); g_signal_connect( G_OBJECT( folderChooser ) , "selection_changed" , G_CALLBACK( record_path_changed ) , NULL );
......
...@@ -3,5 +3,6 @@ include $(top_srcdir)/globals.mak ...@@ -3,5 +3,6 @@ include $(top_srcdir)/globals.mak
noinst_LTLIBRARIES = libaudiorecorder.la noinst_LTLIBRARIES = libaudiorecorder.la
libaudiorecorder_la_SOURCES = \ libaudiorecorder_la_SOURCES = \
audiorecord.cpp audiorecord.cpp \
libsndfile.h audiodsp.h \
audiodsp.cpp
\ No newline at end of file
...@@ -39,7 +39,8 @@ AudioDSP::~AudioDSP() ...@@ -39,7 +39,8 @@ AudioDSP::~AudioDSP()
float AudioDSP::getRMS(int data) float AudioDSP::getRMS(int data)
{ {
printf("AudioDSP::getRMS() : bufPointer_ %i \n ", bufPointer_); // printf("AudioDSP::getRMS() : bufPointer_ %i \n ", bufPointer_);
printf("AudioDSP::getRMS() : %i \n", data);
circBuffer_[bufPointer_++] = (float)data; circBuffer_[bufPointer_++] = (float)data;
if(bufPointer_ >= bufferLength_) if(bufPointer_ >= bufferLength_)
...@@ -56,12 +57,12 @@ float AudioDSP::computeRMS() ...@@ -56,12 +57,12 @@ float AudioDSP::computeRMS()
for(int i = 0; i < bufferLength_; i++){ for(int i = 0; i < bufferLength_; i++){
printf("AudioDSP::computeRMS() : i_ %i \n ", i); // printf("AudioDSP::computeRMS() : i_ %i \n ", i);
rms += (float)(circBuffer_[i]*circBuffer_[i]); rms += (float)(circBuffer_[i]*circBuffer_[i]);
} }
rms = sqrt(rms / (float)bufferLength_); rms = sqrt(rms / (float)bufferLength_);
printf("AudioDSP::computeRMS() : RMS VALUE: %f \n", rms); // printf("AudioDSP::computeRMS() : RMS VALUE: %f \n", rms);
return rms; return rms;
} }
...@@ -431,7 +431,7 @@ void AudioRecord::recData(SFLDataFormat* buffer_1, SFLDataFormat* buffer_2, int ...@@ -431,7 +431,7 @@ void AudioRecord::recData(SFLDataFormat* buffer_1, SFLDataFormat* buffer_2, int
mixBuffer_[k] = (buffer_1[k]+buffer_2[k])/2; mixBuffer_[k] = (buffer_1[k]+buffer_2[k])/2;
dsp.getRMS(mixBuffer_[k]); // dsp.getRMS(mixBuffer_[k]);
if ( fwrite(&buffer_1[k], 2, 1, fp) != 1) if ( fwrite(&buffer_1[k], 2, 1, fp) != 1)
_debug("AudioRecord: Could not record data!\n"); _debug("AudioRecord: Could not record data!\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment