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 });
4 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
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);
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);
you forgot to subscribe the connection
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)
}