Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix C type errors in audio.c #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,15 +624,15 @@ g_print("audio_open_input: format=%d\n",record_audio_format);
switch(record_audio_format) {
case SND_PCM_FORMAT_S16_LE:
g_print("audio_open_input: mic_buffer: size=%d channels=%d sample=%ld bytes\n",r->local_microphone_buffer_size,channels,sizeof(gint16));
r->local_microphone_buffer=g_new(gint16, r->local_microphone_buffer_size);
r->local_microphone_buffer=(float *)g_new(gint16, r->local_microphone_buffer_size);
break;
case SND_PCM_FORMAT_S32_LE:
g_print("audio_open_input: mic_buffer: size=%d channels=%d sample=%ld bytes\n",r->local_microphone_buffer_size,channels,sizeof(gint32));
r->local_microphone_buffer=g_new(gint32, r->local_microphone_buffer_size);
r->local_microphone_buffer=(float *)g_new(gint32, r->local_microphone_buffer_size);
break;
case SND_PCM_FORMAT_FLOAT_LE:
g_print("audio_open_input: mic_buffer: size=%d channels=%d sample=%ld bytes\n",r->local_microphone_buffer_size,channels,sizeof(gfloat));
r->local_microphone_buffer=g_new(gfloat, r->local_microphone_buffer_size);
r->local_microphone_buffer=(float *)g_new(gfloat, r->local_microphone_buffer_size);
break;

default: return -1;
Expand Down Expand Up @@ -1035,7 +1035,7 @@ fprintf(stderr,"mic_read_thread: ALSA: mic_buffer_size=%d\n",radio->local_microp
//g_print("mic_read_thread: -EPIPE: snd_pcm_prepare\n");
if ((rc = snd_pcm_prepare (r->record_handle)) < 0) {
g_print("mic_read_thread: ALSA: cannot prepare audio interface for use %d (%s)\n", rc, snd_strerror (rc));
return rc;
return NULL;
}
} else {
fprintf (stderr, "mic_read_thread: ALSA: read from audio interface failed (%s)\n",
Expand Down