Skip to content

Commit

Permalink
Merge pull request #98 from SHAPE-UP/voice
Browse files Browse the repository at this point in the history
 #96 .wav파일 형식으로 다운로드 폴더 내 저장
  • Loading branch information
Hwater00 authored Oct 3, 2022
2 parents 2392f46 + f80b1c7 commit 47895f4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions SHAPEUP2022/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@
android:usesCleartextTraffic="true">
<activity
android:name=".simulation.SimVoiveActivity"
android:exported="false" />

<activity
android:name=".common.SplashActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name=".common.SplashActivity"
android:exported="true">

</activity>
<activity
android:name=".simulation.SimFinishActivity"
android:exported="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ class SimVoiveActivity : AppCompatActivity() {
Manifest.permission.READ_EXTERNAL_STORAGE
)
private val recordingFilePath: String by lazy {
"${externalCacheDir?.absolutePath}/recording.3gp"
val fileName: String = Date().getTime().toString() + ".wav"
Environment.getExternalStorageDirectory().absolutePath + "/Download/" + fileName //내장메모리 밑에 위치

//"${externalCacheDir?.absolutePath}/recording.3gp"
}
private var state = State.BEFORE_RECORDING
set(value) { // setter 설정
Expand Down Expand Up @@ -125,9 +128,6 @@ class SimVoiveActivity : AppCompatActivity() {
// 녹음 시작 시 초기화
recorder = MediaRecorder()
.apply {
//val fileName: String = Date().getTime().toString() + ".wav"
// output = Environment.getExternalStorageDirectory().absolutePath + "/Download/" + fileName //내장메모리 밑에 위치

setAudioSource(MediaRecorder.AudioSource.MIC)
setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP) // 포멧
setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB) // 엔코더
Expand Down

0 comments on commit 47895f4

Please sign in to comment.