# Copyright (C) 2026 BoundWare LLC. All rights reserved.
# SnacTrac is licensed under the Apache License, Version 2.0
# See Licenses/LICENSE.txt for details.


import io
import pygame
from asset_sound_chaching import *
from asset_sound_click import *
from asset_sound_harp_1 import *
from asset_sound_harp_2 import *
from asset_sound_harp_3 import *
from asset_sound_nope import *
from asset_sound_pickaxe_1 import *
from asset_sound_pickaxe_2 import *
from asset_sound_pickaxe_3 import *
from asset_sound_pop import *
from asset_sound_scrape import *
from asset_sound_tick import *


# Play sound on available channel.
def play_sound(sound):

    sound_data = io.BytesIO(eval(sound))

    sound = pygame.mixer.Sound(sound_data)

    sound.set_volume(0.25)

    channel = pygame.mixer.find_channel()

    if channel:

        channel.play(sound)
