Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b031a3d

Browse files
committed
refaactor: 디버그 메시지 정리
1 parent a639956 commit b031a3d

File tree

3 files changed

+17
-32
lines changed

3 files changed

+17
-32
lines changed

‎Assets/Core/Audio/AudioRecorder.cs‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public bool StartRecording()
102102
// 최대 녹음 시간만큼 버퍼 할당
103103
_recordingClip = Microphone.Start(_currentDevice, false, _maxRecordingLength, _sampleRate);
104104

105-
Debug.Log($"[AudioRecorder] 녹음 시작 - 최대 시간: {_maxRecordingLength}초, 샘플레이트: {_sampleRate}Hz");
105+
Debug.Log($"[AudioRecorder] 음성 녹음 시작됨 (최대 {_maxRecordingLength}초, {_sampleRate}Hz)");
106106
OnRecordingStarted?.Invoke();
107107

108108
return true;
@@ -141,7 +141,7 @@ public bool StartRecording()
141141
AudioClip processedClip = ProcessRecordingClip(actualRecordingDuration);
142142
if (processedClip != null)
143143
{
144-
Debug.Log($"[AudioRecorder] 녹음 완료 - 실제 녹음 시간: {actualRecordingDuration:F2}초, 샘플: {processedClip.samples}");
144+
Debug.Log($"[AudioRecorder] 음성 녹음 완료됨 ({actualRecordingDuration:F1}초, {processedClip.samples} 샘플)");
145145
OnRecordingCompleted?.Invoke(processedClip);
146146
}
147147
}
@@ -199,9 +199,7 @@ public bool SaveRecordingToFile(AudioClip audioClip, string fileName = "recordin
199199
string filePath = System.IO.Path.Combine(Application.persistentDataPath, $"{fileName}.wav");
200200
System.IO.File.WriteAllBytes(filePath, wavData);
201201

202-
Debug.Log($"[AudioRecorder] 녹음 파일 저장 완료: {filePath}");
203-
Debug.Log($"[AudioRecorder] 파일 크기: {wavData.Length} bytes");
204-
Debug.Log($"[AudioRecorder] AudioClip 정보 - 샘플: {audioClip.samples}, 채널: {audioClip.channels}, 주파수: {audioClip.frequency}");
202+
Debug.Log($"[AudioRecorder] 녹음 파일 저장됨: {filePath} ({wavData.Length} bytes)");
205203

206204
return true;
207205
}
@@ -237,7 +235,6 @@ public void SetMicrophone(string deviceName)
237235
if (Array.Exists(Microphone.devices, device => device == deviceName))
238236
{
239237
_currentDevice = deviceName;
240-
Debug.Log($"[AudioRecorder] 마이크 설정 변경: {deviceName}");
241238
}
242239
else
243240
{
@@ -258,7 +255,6 @@ private void InitializeMicrophone()
258255
if (devices.Length > 0)
259256
{
260257
_currentDevice = devices[0];
261-
Debug.Log($"[AudioRecorder] 기본 마이크 설정: {_currentDevice}");
262258
}
263259
else
264260
{
@@ -281,7 +277,7 @@ private void InitializeMicrophone()
281277
int maxSamples = _recordingClip.samples;
282278
actualSamples = Mathf.Min(actualSamples, maxSamples);
283279

284-
Debug.Log($"[AudioRecorder] 실제 녹음 길이: {actualSamples} 샘플, 전체 버퍼: {_recordingClip.samples} 샘플, 실제 시간: {actualDuration:F2}");
280+
Debug.Log($"[AudioRecorder] 녹음 데이터 처리 중 ({actualSamples}/{_recordingClip.samples} 샘플, {actualDuration:F1}초)");
285281

286282
if (actualSamples <= 0)
287283
{
@@ -310,7 +306,7 @@ private void InitializeMicrophone()
310306
processedClip.SetData(samples, 0);
311307
_recordingClip = processedClip;
312308

313-
Debug.Log($"[AudioRecorder] 처리된 AudioClip - 샘플: {_recordingClip.samples}, 채널: {_recordingClip.channels}, 주파수: {_recordingClip.frequency}");
309+
Debug.Log($"[AudioRecorder] AudioClip 생성 완료 ({_recordingClip.samples} 샘플, {_recordingClip.channels} 채널, {_recordingClip.frequency}Hz)");
314310

315311
return _recordingClip;
316312
}

‎Assets/Domain/Chat/View/VoiceInputView.cs‎

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ public class VoiceInputView : MonoBehaviour
2525
[SerializeField] private string _voiceStatusRecording = "Recording..."; // "녹음 중..."에서 변경
2626
[SerializeField] private string _voiceStatusProcessing = "Converting speech to text..."; // "음성을 텍스트로 변환 중..."에서 변경
2727

28-
[Header("Debug Settings")]
29-
[SerializeField] private bool _saveRecordingToFile = true;
28+
3029

3130
private ChatManager? _chatManager;
3231
private AudioRecorder? _audioRecorder;
@@ -176,13 +175,6 @@ public void StopVoiceRecording()
176175
AudioClip? recordedClip = _audioRecorder.StopRecording();
177176
if (recordedClip != null)
178177
{
179-
// 디버깅을 위한 파일 저장
180-
if (_saveRecordingToFile)
181-
{
182-
string timestamp = System.DateTime.Now.ToString("yyyyMMdd_HHmmss");
183-
_audioRecorder.SaveRecordingToFile(recordedClip, $"voice_recording_{timestamp}");
184-
}
185-
186178
byte[] audioData = _audioRecorder.AudioClipToWavBytes(recordedClip);
187179
if (audioData.Length > 0)
188180
{
@@ -349,14 +341,13 @@ public async void TestSTTWithDummyAudio()
349341

350342
try
351343
{
352-
Debug.Log("[VoiceInputView] 더미 음성으로 STT 서버 테스트 시작");
353344
byte[] dummyAudio = _sttService.GenerateTestAudioData();
354345
string result = await _sttService.ConvertSpeechToTextAsync(dummyAudio);
355-
Debug.Log($"[VoiceInputView] 더미 음성 테스트 결과: '{result}'");
346+
Debug.Log($"[VoiceInputView] STT 테스트 결과: '{result}'");
356347
}
357348
catch (Exception ex)
358349
{
359-
Debug.LogError($"[VoiceInputView] 더미 음성 테스트 실패: {ex.Message}");
350+
Debug.LogError($"[VoiceInputView] STT 테스트 실패: {ex.Message}");
360351
}
361352
}
362353

@@ -372,28 +363,26 @@ private void OnVoiceStopButtonClicked()
372363

373364
private void OnRecordingStarted()
374365
{
375-
Debug.Log("[VoiceInputView] 녹음 시작됨");
366+
// AudioRecorder에서 로그 출력
376367
}
377368

378369
private void OnRecordingStopped()
379370
{
380-
Debug.Log("[VoiceInputView] 녹음 중지됨");
371+
// AudioRecorder에서 로그 출력
381372
}
382373

383374
private void OnRecordingCompleted(AudioClip audioClip)
384375
{
385-
Debug.Log($"[VoiceInputView] 녹음 완료 - 샘플: {audioClip.samples}, 길이: {audioClip.length:F2}초");
376+
// AudioRecorder에서 로그 출력
386377
}
387378

388379
private void OnRecordingProgress(float progress)
389380
{
390381
UpdateProgressBar(progress);
391-
// Debug.Log($"[VoiceInputView] 녹음 진행률: {progress:P0}"); // 디버그 메시지 제거
392382
}
393383

394384
private void OnRecordingError(string error)
395385
{
396-
Debug.LogError($"[VoiceInputView] 녹음 오류: {error}");
397386
OnError?.Invoke(error);
398387
}
399388

‎Assets/UI/Prefabs/AudioInputView.prefab‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ MonoBehaviour:
188188
m_Calls: []
189189
m_text: Stop
190190
m_isRightToLeft: 0
191-
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
192-
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
191+
m_fontAsset: {fileID: 11400000, guid: 30927a58b1be6fe418e6eacbf0e593c2, type: 2}
192+
m_sharedMaterial: {fileID: -7107498392211080374, guid: 30927a58b1be6fe418e6eacbf0e593c2, type: 2}
193193
m_fontSharedMaterials: []
194194
m_fontMaterial: {fileID: 0}
195195
m_fontMaterials: []
@@ -324,8 +324,8 @@ MonoBehaviour:
324324
m_Calls: []
325325
m_text: New Text
326326
m_isRightToLeft: 0
327-
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
328-
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
327+
m_fontAsset: {fileID: 11400000, guid: 30927a58b1be6fe418e6eacbf0e593c2, type: 2}
328+
m_sharedMaterial: {fileID: -7107498392211080374, guid: 30927a58b1be6fe418e6eacbf0e593c2, type: 2}
329329
m_fontSharedMaterials: []
330330
m_fontMaterial: {fileID: 0}
331331
m_fontMaterials: []
@@ -659,8 +659,8 @@ MonoBehaviour:
659659
m_Calls: []
660660
m_text: Recode
661661
m_isRightToLeft: 0
662-
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
663-
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
662+
m_fontAsset: {fileID: 11400000, guid: 30927a58b1be6fe418e6eacbf0e593c2, type: 2}
663+
m_sharedMaterial: {fileID: -7107498392211080374, guid: 30927a58b1be6fe418e6eacbf0e593c2, type: 2}
664664
m_fontSharedMaterials: []
665665
m_fontMaterial: {fileID: 0}
666666
m_fontMaterials: []

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /