How to seek an aduio

const resource = createAudioResource(path, { seek: 60000, volume: 1 });
player.play(resource)
const resource = createAudioResource(path, { seek: 60000, volume: 1 });
player.play(resource)
const resource = createAudioResource(path);
player.play(resource, { seek: 60000, volume: 1 });
const resource = createAudioResource(path);
player.play(resource, { seek: 60000, volume: 1 });
I tired both, they do not seek djs v 13.14 @discordjs/[email protected]
4 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
! Alk
! AlkOP2y ago
let connection = getVoiceConnection(channel.guild.id)

if (!connection) connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});

let player = createAudioPlayer()

connection.subscribe(player)
// const audioPlayer = createAudioPlayer();
console.log(path)
const audioStream = createReadStream(path);
const ffmpeg = new FFmpeg({
args: [
'-ss', String(20),
'-i', audioStream
],
});

const resource = createAudioResource(ffmpeg, { inputType: StreamType.Raw });

player.play(resource);
let connection = getVoiceConnection(channel.guild.id)

if (!connection) connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});

let player = createAudioPlayer()

connection.subscribe(player)
// const audioPlayer = createAudioPlayer();
console.log(path)
const audioStream = createReadStream(path);
const ffmpeg = new FFmpeg({
args: [
'-ss', String(20),
'-i', audioStream
],
});

const resource = createAudioResource(ffmpeg, { inputType: StreamType.Raw });

player.play(resource);
it just start and stop
const { FFmpeg } = require('prism-media');
let { createReadStream } = require("fs");

const audioStream = createReadStream(path);
console.log("2")
const audio = new FFmpeg({ source: audioStream });//.setSartTime('0:10')

const resource = createAudioResource(audio, { inputType: StreamType.Raw });
console.log(resource)
console.log("3")

player.play(resource);
const { FFmpeg } = require('prism-media');
let { createReadStream } = require("fs");

const audioStream = createReadStream(path);
console.log("2")
const audio = new FFmpeg({ source: audioStream });//.setSartTime('0:10')

const resource = createAudioResource(audio, { inputType: StreamType.Raw });
console.log(resource)
console.log("3")

player.play(resource);
no sound : (
Idris
Idris2y ago
you forgot to subscribe the connection
! Alk
! AlkOP2y ago
let connection = getVoiceConnection(channel.guild.id)

if (!connection) connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});

let player = createAudioPlayer()

try {
path = "./allSounds/voice.mp3";
connection.subscribe(player)

console.log("1")
const audioStream = createReadStream(path);

console.log("2")
const audio = new FFmpeg({ source: audioStream

const resource = createAudioResource(audio, { inputType: StreamType.Raw });
console.log(resource)
console.log("3")

player.play(resource);
} catch (e) {
console.log(e)
}
let connection = getVoiceConnection(channel.guild.id)

if (!connection) connection = joinVoiceChannel({
channelId: channel.id,
guildId: channel.guild.id,
adapterCreator: channel.guild.voiceAdapterCreator,
});

let player = createAudioPlayer()

try {
path = "./allSounds/voice.mp3";
connection.subscribe(player)

console.log("1")
const audioStream = createReadStream(path);

console.log("2")
const audio = new FFmpeg({ source: audioStream

const resource = createAudioResource(audio, { inputType: StreamType.Raw });
console.log(resource)
console.log("3")

player.play(resource);
} catch (e) {
console.log(e)
}
it's there
Want results from more Discord servers?
Add your server