Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: webrtc/voice_engine/file_player.cc

Issue 2790493004: Supporting 48kHz PCM file. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« webrtc/voice_engine/file_player.h ('K') | « webrtc/voice_engine/file_player.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/file_player.cc
diff --git a/webrtc/voice_engine/file_player.cc b/webrtc/voice_engine/file_player.cc
index 4ee1322e9b9f5a123e968bbd564dd15dcce567e8..81ba34fa7a7804f5d21a25d7fa298190854377b5 100644
--- a/webrtc/voice_engine/file_player.cc
+++ b/webrtc/voice_engine/file_player.cc
@@ -100,7 +100,7 @@ int32_t FilePlayerImpl::Frequency() const {
} else if (_codec.plfreq == 44000) {
return 32000;
} else if (_codec.plfreq == 48000) {
- return 32000;
+ return 48000;
} else {
return _codec.plfreq;
}
@@ -220,16 +220,18 @@ int32_t FilePlayerImpl::StartPlayingFile(const char* fileName,
codecInstL16.rate = 128000;
codecInstL16.plfreq = 8000;
codecInstL16.pacsize = 80;
-
} else if (_fileFormat == kFileFormatPcm16kHzFile) {
codecInstL16.rate = 256000;
codecInstL16.plfreq = 16000;
codecInstL16.pacsize = 160;
-
} else if (_fileFormat == kFileFormatPcm32kHzFile) {
codecInstL16.rate = 512000;
codecInstL16.plfreq = 32000;
- codecInstL16.pacsize = 160;
+ codecInstL16.pacsize = 320;
+ } else if (_fileFormat == kFileFormatPcm48kHzFile) {
+ codecInstL16.rate = 768000;
+ codecInstL16.plfreq = 48000;
+ codecInstL16.pacsize = 480;
} else {
LOG(LS_ERROR) << "StartPlayingFile() sample frequency not "
<< "supported for PCM format.";
@@ -277,7 +279,8 @@ int32_t FilePlayerImpl::StartPlayingFile(InStream* sourceStream,
const CodecInst* codecInst) {
if (_fileFormat == kFileFormatPcm16kHzFile ||
_fileFormat == kFileFormatPcm32kHzFile ||
- _fileFormat == kFileFormatPcm8kHzFile) {
+ _fileFormat == kFileFormatPcm8kHzFile ||
+ _fileFormat == kFileFormatPcm48kHzFile) {
CodecInst codecInstL16;
strncpy(codecInstL16.plname, "L16", 32);
codecInstL16.pltype = 93;
@@ -287,16 +290,18 @@ int32_t FilePlayerImpl::StartPlayingFile(InStream* sourceStream,
codecInstL16.rate = 128000;
codecInstL16.plfreq = 8000;
codecInstL16.pacsize = 80;
-
} else if (_fileFormat == kFileFormatPcm16kHzFile) {
codecInstL16.rate = 256000;
codecInstL16.plfreq = 16000;
codecInstL16.pacsize = 160;
-
} else if (_fileFormat == kFileFormatPcm32kHzFile) {
codecInstL16.rate = 512000;
codecInstL16.plfreq = 32000;
- codecInstL16.pacsize = 160;
+ codecInstL16.pacsize = 320;
+ } else if (_fileFormat == kFileFormatPcm48kHzFile) {
+ codecInstL16.rate = 768000;
+ codecInstL16.plfreq = 48000;
+ codecInstL16.pacsize = 480;
} else {
LOG(LS_ERROR) << "StartPlayingFile() sample frequency not "
<< "supported for PCM format.";
@@ -379,6 +384,7 @@ std::unique_ptr<FilePlayer> FilePlayer::CreateFilePlayer(
case kFileFormatPcm16kHzFile:
case kFileFormatPcm8kHzFile:
case kFileFormatPcm32kHzFile:
+ case kFileFormatPcm48kHzFile:
// audio formats
return std::unique_ptr<FilePlayer>(
new FilePlayerImpl(instanceID, fileFormat));
« webrtc/voice_engine/file_player.h ('K') | « webrtc/voice_engine/file_player.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698