-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
eric
committed
Jan 4, 2018
1 parent
1b4886e
commit f0c54d8
Showing
2 changed files
with
77 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
rtmpfile/src/main/java/com/wangheart/rtmpfile/utils/ADTSUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.wangheart.rtmpfile.utils; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* Author : eric | ||
* CreateDate : 2018/1/4 15:28 | ||
* Email : [email protected] | ||
* Version : 2.0 | ||
* Desc : | ||
* Modified : | ||
*/ | ||
|
||
public class ADTSUtils { | ||
private static Map<String, Integer> SAMPLE_RATE_TYPE; | ||
|
||
static { | ||
SAMPLE_RATE_TYPE = new HashMap<>(); | ||
SAMPLE_RATE_TYPE.put("96000", 0); | ||
SAMPLE_RATE_TYPE.put("88200", 1); | ||
SAMPLE_RATE_TYPE.put("64000", 2); | ||
SAMPLE_RATE_TYPE.put("48000", 3); | ||
SAMPLE_RATE_TYPE.put("44100", 4); | ||
SAMPLE_RATE_TYPE.put("32000", 5); | ||
SAMPLE_RATE_TYPE.put("24000", 6); | ||
SAMPLE_RATE_TYPE.put("22050", 7); | ||
SAMPLE_RATE_TYPE.put("16000", 8); | ||
SAMPLE_RATE_TYPE.put("12000", 9); | ||
SAMPLE_RATE_TYPE.put("11025", 10); | ||
SAMPLE_RATE_TYPE.put("8000", 11); | ||
SAMPLE_RATE_TYPE.put("7350", 12); | ||
} | ||
|
||
public static int getSampleRateType(int sampleRate) { | ||
return SAMPLE_RATE_TYPE.get(sampleRate + ""); | ||
} | ||
} |