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

Allow forcing the audio recording format to WAV #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions include/mediastreamer2/msfilerec.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ extern MSFilterDesc ms_file_rec_desc;
#define MS_FILE_REC_START MS_FILTER_METHOD_NO_ARG(MS_FILE_REC_ID,1)
#define MS_FILE_REC_STOP MS_FILTER_METHOD_NO_ARG(MS_FILE_REC_ID,2)
#define MS_FILE_REC_CLOSE MS_FILTER_METHOD_NO_ARG(MS_FILE_REC_ID,3)
#define MS_FILE_REC_FORCE_WAV MS_FILTER_METHOD_NO_ARG(MS_FILE_REC_ID,4)



Expand Down
7 changes: 7 additions & 0 deletions src/audiofilters/msfilerec.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,12 @@ static int rec_set_max_size(MSFilter *f, void *arg) {
return 0;
}

static int rec_force_wav(MSFilter *f, void *arg) {
RecState *d=(RecState*)f->data;
d->is_wav = TRUE;
return 0;
}

static MSFilterMethod rec_methods[]={
{ MS_FILTER_SET_SAMPLE_RATE, rec_set_sr },
{ MS_FILTER_SET_NCHANNELS , rec_set_nchannels },
Expand All @@ -307,6 +313,7 @@ static MSFilterMethod rec_methods[]={
{ MS_FILTER_GET_OUTPUT_FMT, rec_get_fmtp },
{ MS_FILTER_SET_OUTPUT_FMT, rec_set_fmtp },
{ MS_RECORDER_SET_MAX_SIZE, rec_set_max_size },
{ MS_FILE_REC_FORCE_WAV , rec_force_wav },
{ 0 , NULL }
};

Expand Down