Removed unused audio utilities and audio-recording (e.g. for Chatter)

This commit is contained in:
Maruno17
2021-01-17 20:47:57 +00:00
parent 33ee7f0c9a
commit cb684094be
13 changed files with 199 additions and 1679 deletions

View File

@@ -672,74 +672,6 @@ end
#===============================================================================
# Voice recorder
#===============================================================================
def pbRecord(text,maxtime=30.0)
text = "" if !text
textwindow = Window_UnformattedTextPokemon.newWithSize(text,0,0,Graphics.width,Graphics.height-96)
textwindow.z=99999
if text==""
textwindow.visible = false
end
wave = nil
msgwindow = pbCreateMessageWindow
oldvolume = Audio_bgm_get_volume()
Audio_bgm_set_volume(0)
delay = 2
delay.times do |i|
pbMessageDisplay(msgwindow,_INTL("Recording in {1} second(s)...\nPress ESC to cancel.",delay-i),false)
Graphics.frame_rate.times do
Graphics.update
Input.update
textwindow.update
msgwindow.update
if Input.trigger?(Input::B)
Audio_bgm_set_volume(oldvolume)
pbDisposeMessageWindow(msgwindow)
textwindow.dispose
return nil
end
end
end
pbMessageDisplay(msgwindow,_INTL("NOW RECORDING\nPress ESC to stop recording."),false)
if beginRecordUI
frames = (maxtime*Graphics.frame_rate).to_i
frames.times do
Graphics.update
Input.update
textwindow.update
msgwindow.update
if Input.trigger?(Input::B)
break
end
end
tmpFile = ENV["TEMP"]+"\\record.wav"
endRecord(tmpFile)
wave = getWaveDataUI(tmpFile,true)
if wave
pbMessageDisplay(msgwindow,_INTL("PLAYING BACK..."),false)
textwindow.update
msgwindow.update
Graphics.update
Input.update
wave.play
(Graphics.frame_rate*wave.time).to_i.times do
Graphics.update
Input.update
textwindow.update
msgwindow.update
end
end
end
Audio_bgm_set_volume(oldvolume)
pbDisposeMessageWindow(msgwindow)
textwindow.dispose
return wave
end
#===============================================================================
# Event movement
#===============================================================================