[Music]フェードアウト からの フェードイン ボリュームを戻す版
sound volume を 100に基準ではなくて
スクリプトを実行したタイミングの音量を元に
フェードアウトフェードインで次の曲へ
#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions
####1曲何秒聴く?
set numTimer to 30 as integer
###何曲
set numCntRep to 5000 as number
####何曲目
set numCnt to 0 as number
tell application "Music"
set numVolume to sound volume
end tell
repeat numCntRep times
tell application "Music"
set sound volume to numVolume
set objState to (player state)
if objState is playing then
log "再生中"
set objNowTrack to current track
set objNowTrack to current track
name of objNowTrack as text
album of objNowTrack as text
artist of objNowTrack as text
##################
delay numTimer
##################
###フェードアウト
set sound volume to numVolume
set numTempVolume to numVolume
repeat 10 times
set sound volume to numTempVolume
set numTempVolume to (numTempVolume - (numVolume / 10)) as integer
delay 0.1
end repeat
set sound volume to 0
##################
###次の曲
next track
##################
###フェードイン
set numVolume to numVolume as integer
set sound volume to 0 as integer
set numTempVolume to 0 as integer
repeat 10 times
set sound volume to numTempVolume
set numTempVolume to (numTempVolume + (numVolume / 10)) as integer
delay 0.1
end repeat
set sound volume to numVolume
else if objState is paused then
set sound volume to numVolume
log "ポーズ中"
try
set objNowTrack to current track
play
on error
exit repeat
end try
else if objState is stopped then
set sound volume to 100
log "停止中"
try
set objNowTrack to current track
play
on error
exit repeat
end try
end if
end tell
set numCnt to (numCnt + 1) as number
log numCnt
---リピートの終わり
end repeat
| 固定リンク
「Media Music」カテゴリの記事
- [Music]メタデータの文字化け置換(EU系の文字化けの置換) 少し増えた(2024.03.18)
- [shortcut]再生中の音楽をShazamでしらべてタイトルアーティストを設定する(2023.12.11)
- [Music]メタデータの文字化け置換(1つ毎処理)(2023.12.09)
- [afinfo]ミュージックファイルの詳細メタ情報の取得(2023.11.01)
- [com.apple.metadata]オーディオファイルのコメントにビットレートを入れる(2023.11.01)