No Audio Is Played

Hello! I'm new to using @discordjs/voice so I'm hoping I'm just missing something simple.

I'm trying to get my bot to play a local audio file within voice. The bot joins the channel, but doesn't make a noise.

This is the relevant code:
const player = createAudioPlayer({
    debug: true,
});

const resource = createAudioResource(`/Volumes/Files/audio/music.ogg`);
const connection = joinVoiceChannel({
    adapterCreator: channel.guild.voiceAdapterCreator,
    guildId: channel.guild.id,
    channelId: channel.id,
});

connection.subscribe(player);
connection.on("stateChange", (oldState, newState) => {
    if (
        oldState.status === VoiceConnectionStatus.Ready &&
        newState.status === VoiceConnectionStatus.Connecting
    ) {
        connection.configureNetworking();
    }
});

player.play(resource);
player.unpause();


I was wondering if anyone could point me in the direction of the cause? The bot is auto-pausing so I believe it is do with the resource. Thank you!

discord.js@14.7.1
@discordjs/voice@0.14.0
node v18.13.0
Was this page helpful?