Skip to content

Commit

Permalink
fox #100: try to add audio/PCMA & audio/PCMU
Browse files Browse the repository at this point in the history
  • Loading branch information
mpromonet committed May 26, 2018
1 parent 35218ba commit 7ead761
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ snd_pcm_format_t decodeAudioFormat(const std::string& fmt)
audioFmt = SND_PCM_FORMAT_S32_BE;
} else if (fmt == "S32_LE") {
audioFmt = SND_PCM_FORMAT_S32_LE;
} else if (fmt == "ALAW") {
audioFmt = SND_PCM_FORMAT_A_LAW;
} else if (fmt == "MULAW") {
audioFmt = SND_PCM_FORMAT_MU_LAW;
} else if (fmt == "S8") {
audioFmt = SND_PCM_FORMAT_S8;
}
Expand All @@ -239,6 +243,12 @@ std::string getAudioRtpFormat(snd_pcm_format_t format, int sampleRate, int chann
std::ostringstream os;
os << "audio/";
switch (format) {
case SND_PCM_FORMAT_A_LAW:
os << "PCMA";
break;
case SND_PCM_FORMAT_MU_LAW:
os << "PCMU";
break;
case SND_PCM_FORMAT_S8:
os << "L8";
break;
Expand Down

0 comments on commit 7ead761

Please sign in to comment.