bwmarrin / dca Goto Github PK
View Code? Open in Web Editor NEWSpecification & Tool the Discord Audio (dca) file format, supported by all the best Discord libs.
License: BSD 3-Clause "New" or "Revised" License
Specification & Tool the Discord Audio (dca) file format, supported by all the best Discord libs.
License: BSD 3-Clause "New" or "Revised" License
Would be good to have the ability to pipe raw audio into DCA without writing to a file first.
Would be good to have Opus to PCM16 conversion (mainly so I can implement audio receiving into my lib and have full features ❤️ ) so the user can do anything with that (save it, convert it to another format like MP3 etc.)
Would be good to have the ability to pass through FFmpeg command line options so we can adjust volume, channels etc.
The go get line in the readme is
go get github.com/bwmarrin/dca
Shouldn't it be
go get github.com/bwmarrin/dca/cmd/dca
(Using Go for Windows x64)
There seems to be issue when audio file doesn't have the ID3 tags.
For command dca -ab 96 -i "D:\01 - Bubblegum Bitch.flac" > D:\file.dca
, where input is set to file converted from the CD. Shell is empty and resulting file.dca is regularly playable in Discord.
For command dca -ab 96 -i "D:\01 - Bubblegum Bitch_nometa.flac" > D:\file.dca
, where input is set to file with removed ID3 tags. The output is 0Byte file.dca and shell output is:
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x1 addr=0x0 pc=0x40357c]
goroutine 1 [running]:
panic(0x5ad020, 0xc082008080)
C:/Go/src/runtime/panic.go:464 +0x3f4
main.main()
C:/Go/src/github.com/bwmarrin/dca/cmd/dca/main.go:239 +0x1d3c
I'd say, if dca requires these metadata, they should set to something if empty instead of ignoring the file completely. I wanted to use dca for files uploaded by other people, thus I cannot really change metadata for them without using another 3rd party tool.
I'm trying to play mp3 file from url. But i hear only noise. If i download file from this url and try play it with VoiceClient->playFile method then it's work. Can i play this file from stream? Sorry for my broken english.
$this->discord->getVoiceClient($channel->guild_id)->then(
function (VoiceClient $client) use ($bot, $channel, $url, $message) {
$client->setVolume(30);
$resource = fopen($url, 'r');
$client->playRawStream($resource)->then(function () use ($bot, $channel, $message) {
//...
}, function (\Exception $e) use ($bot, $channel, $message) {
//...
});;
});
Would be good to have a volume option for FFmpeg.
Possibly also a way to pass through a string of parameters to FFmpeg.
Would we be able to package Opus with DCA? Saw it suggested over on a gopus issue (layeh/gopus#2).
I converted a bunch of audio files from .wav
to .dca
, and then lost the originals.
Is it possible to convert a .dca
file back to .wav
(or any other mainstream format)?
Topics for discussion:
Would be awesome to be able to ship DCA with binaries. Would make it a lot easier to install.
I'm able to build it on:
ffmpeg can be called with a url and so dca should allow that as well :)
Add some code to parse the input and if it looks like a valid URL then skip the file check.
We've discussed on Discord that DCA files should contain metadata as the first packet - the very first byte will specify the metadata length and the rest of the first packet will contain a JSON of the metadata. Then, starting with the second packet, opus will resume as normal. Here are some metadata fields I propose:
version
- a number that gets incremented every time something changes in the actual DCA file format, starts at 1
rev
- a specifier that determines which revision of dca was used to generate this (for example bwmarrin/dca#32361ee92fcbd0e404b2be18adf497a45fef4a5f
)tool
- if a separate tool was used to generate this DCA file, this field contains information about what tool and the revision in the same format as rev
source
- where this DCA file was generated from (file
, stdin
or other things in the future)abr
- the audio bitrate in kbit/surl
- if the track was downloaded from somewhere, the URL where it can be foundtitle
(self-explanatory)author
(self-explanatory)y-
prefix can be reserved for information copied over from youtube-dl's JSON file, and the x-
prefix can be reserved for other fields the particular tool/library needs.Added in response to 188480082 and 189713886:
sample_rate
- Opus audio sample rate in kbit/sapplication
- Opus audio application - voip
/music
/lowdelay
. I chose application over mode because it's more commonly used everywhere elsevbr
- Opus variable bitrate settingframe_size
- Opus frame size in bitschannels
- Number of audio channelsalbum
/genre
/track_num
(self-explanatory)f-
prefix for those specific fields?All of these are just suggestions and most are probably useless, please suggest others and comment on existing ones!
We should add the ability to accept opus ogg files and remux them into DCA1 format.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.