-
-
Notifications
You must be signed in to change notification settings - Fork 246
Closed
Labels
staleInformation contained within may be old or outdated.Information contained within may be old or outdated.voice
Description
$discord->joinVoiceChannel($channel, false, false, null, true)->then(function (VoiceClient $vc) use ($channel, $ffmpeg,
$audioOutput) {
$vc->playFile(storage_path('44.wav')); // work
$vc->on('ready', function(...$data) use($vc, $audioOutput){ //never called
dump(['ready', $data]);
$receiveStream = $vc->getRecieveStream(272445599360614401);
dump(['receive stream', $receiveStream?->isReadable()]);
$dest = new \React\Stream\WritableResourceStream(fopen($audioOutput, 'a'));
$receiveStream?->pipeOpus($dest);
echo "Stream recorded.", PHP_EOL;
});
$vc->on('channel-opus', function(...$data) use($audioOutput){ //never called
dump(['speak', $data]);
});
$vc->on('channel-pcm', function(...$data) use($audioOutput){ //never called
dump(['speak', $data]);
});
},function ($err){ dump($err); });
Can someone write an example of recording voice to disk?
Nerahikada
Metadata
Metadata
Assignees
Labels
staleInformation contained within may be old or outdated.Information contained within may be old or outdated.voice