Earphone Soundplayers (#20964)

Adds soundplayer functionality to earphones, headphones and earbuds.
They can now play music, loaded via music cartridges with preset
playlists.

Heavily based off CMSS13's Walkmans and our Audioconsoles.

Current Features:

- All earphones have a cartridge slot. Cartridges can be inserted by
clicking an earphone, and removed via an eject_music_cartridge() verb.
- Inserting a cartridge will load a playlist containing /datum/tracks,
where track names and sound files are loaded.
- Shift+Clicking or will Start/Stop a playlist, creating or deleting an
active sound_player token.
- Alt+Clicking with Pause/Unpause the current track, preserving an
active sound_player token.
- Attack_self will eject the music cartridge. Ejecting a music cartridge
also terminates the sound_player token.
- Volume controllable via verb.

Missing features i am too weak to figure out:

- There is no auto—next song, and a user must manually use next_song()
or previous_song() verbs to iterate through a playlist.
- Part and parcel with no auto-next: Tracks automatically loop due to
using the PlayLoopingSound() proc. Ideally, tracks should not loop.
-  There is no accomodation for user-uploaded sound files.
- There are no UI implementations of earphone controls, which could be
more user friendly.

Music Cartridge CoderIcons:
<img width="430" height="106" alt="aaa"
src="https://github.com/user-attachments/assets/5c15d5f4-b2e1-4ece-8076-2e93a5853168"
/>

### Asset Licenses
The following assets that **have not** been created by myself are
included in this PR:

| Path | Original Author | License |
| --- | --- | --- |
| sound/music/regional/venus/all_night.ogg | Rollergirl
(https://rollergirl.bandcamp.com/album/rollergirl) | CC BY-NC-SA 3.0 |
| sound/music/regional/venus/billy_ocean.ogg | Rollergirl
(https://rollergirl.bandcamp.com/album/rollergirl) | CC BY-NC-SA 3.0 |
| sound/music/regional/venus/artificially_sweetened.ogg | Stevia Sphere
(https://steviasphere.bandcamp.com/album/artificially-sweetened-single)
| CC BY 3.0 |
|sound/music/regional/venus/real_love.ogg | Stevia Sphere
(https://steviasphere.bandcamp.com/album/artificially-sweetened-single)
| CC BY 3.0 |
| sound/music/regional/venus/dance.ogg | ウナチャンUNACHAN
(https://unachan.bandcamp.com/track/dance) | CC BY 3.0 |
| sound/music/regional/venus/love_sensation.ogg | ウナチャンUNACHAN and
bedroomtheft (https://unachan.bandcamp.com/track/love-sensation) | CC BY
3.0 |
| sound/music/regional/venus/funky_girl.ogg | B~mO9000
(https://bmo9000.bandcamp.com/album/v-i-n-t-a-g-e) | CC BY-NC-SA 3.0 |
| sound/music/regional/venus/break_the_system.ogg |
(https://bmo9000.bandcamp.com/album/wanted-in-80s [Download Only]) | CC
CC BY-SA 3.0 |
| sound/music/regional/xanu/xanu_rock_3.ogg | Swara Sutra
(https://swarasutra.bandcamp.com/album/indulgence) | CC BY-SA 3.0 |

All sound files compressed to 20K sample rate. No
transformations/remixing
This commit is contained in:
smellie
2025-07-22 10:08:40 +00:00
committed by GitHub
parent ff5927c692
commit d438053ddd
28 changed files with 2986 additions and 2554 deletions
+11
View File
@@ -36,6 +36,17 @@ GLOBAL_DATUM_INIT(sound_player, /singleton/sound_player, new)
return PlaySoundDatum(source, sound_id, S, range, prefer_mute, sound_type)
/singleton/sound_player/proc/PlayNonloopingSound(atom/source, sound_id, sound, volume, range, falloff = 1, echo, frequency, prefer_mute, sound_type = ASFX_AMBIENCE)
var/sound/S = istype(sound, /sound) ? sound : new(sound)
S.environment = 0 // Ensures a 3D effect even if x/y offset happens to be 0 the first time it's played
S.volume = volume
S.falloff = falloff
S.echo = echo
S.frequency = frequency
S.repeat = FALSE
return PlaySoundDatum(source, sound_id, S, range, prefer_mute, sound_type)
/singleton/sound_player/proc/PrivStopSound(datum/sound_token/sound_token)
var/channel = sound_token.sound.channel
var/sound_id = sound_token.sound_id