g711 | Go package to encode and decode ITU-T G.711 sound data
kandi X-RAY | g711 Summary
kandi X-RAY | g711 Summary
Go package to encode and decode ITU-T G.711 sound data
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- encodeG711 encodes a G711 file
- decodeG711 decodes a g711 file
- EncodeAlawFrame encodes a given frame .
- EncodeUlawFrame encodes a uiemann frame .
- main is the main entry point .
- Write encodes p to the destination
- NewUlawEncoder returns a new encoder that writes to w .
- NewAlawEncoder returns a new encoder that encodes the input to w .
- NewUlawDecoder returns a new Decoder .
- EncodeUlaw encodes a ulpcm .
g711 Key Features
g711 Examples and Code Snippets
Community Discussions
Trending Discussions on g711
QUESTION
I have a raw file that includes encoded data with g711 audio codec. FFMpeg decoded successfully the raw file. I want to split the wav file by time so I used segment_time
option.
Here is my code:
ANSWER
Answered 2021-Mar-24 at 17:20Here are 3 methods:
1. Look at the console output / logIt will output lines like:
QUESTION
I try to encode raw PCM sound to G711A and G711U and then decode it, with this codecs everything works fine because I can choose any value for AVCodecContext frame_size for encoding, but in case of Opus codec the AVCodecContext frame_size is equal to 120, so if I understood correctly if my input data array size is bigger than 120 then I need to do some kind of buffering and split my input data into several parts and then sequentially put it to AVFrame->data and pass the AVFrame to encoding.
In result I get a very bad sound and I get this result not only when I use Opus codec but also in G711 if I set it's AVCodecContext frame_size to some value that will be less than size of my input data.
So my question is: what it the correct way to encode input data if it's size if bigger than AVCodecContext frame_size? Do I need to split my input data into some parts that <= AVCodecContext frame_size if so how should I do that?
At this moment my code looks like this:
...ANSWER
Answered 2020-Apr-17 at 11:34You said it all, "so if I understood correctly if my input data array size is bigger than 120 then I need to do some kind of buffering and split my input data into several parts and then sequentially put it to AVFrame->data and pass the AVFrame to encoding."
This is what you need. BUffer the samples and send the fixed amount each time for encoding.
QUESTION
I'm trying to use NAudio to make a client to simulate a softphone to send telephony RTP packets in g.711 MuLaw format by capturing the local microphone/speaker devices, but this process is missing some steps that don't make sense with the outdated information available. MuLaw is incompatible with MediaFoundationResampler and WdlResampler, the ACM resampler garbles the audio quality completely, and the below code gets me to PCM but from there there's no information on how to go forward. Is there supposed to be a low-pass filter or something added here? Are you supposed to be converting the raw byte data from the WasapiCapture event to 16-bit according to a 2013 article (which is incompatible with the MFR anyway)?
I have no knowledge or experience working with audio, so this entire process is foreign to me and need some direction on where to proceed from here, as the only closest answer didn't actually post how they "solved" it.
...ANSWER
Answered 2019-Jul-11 at 23:49After struggling with this library and hacking together several different recommendations from various sources, I ended up with something that finally worked, so hopefully this saves others a lot of headache.
I essentially had to roll my own IWaveProvider and do various custom filters and whatnot until it worked.
QUESTION
I am using NAudio to attempt to convert Linear16 PCM wav files that come out of a 3rd party Text-To-Speech API to G711 8-bit 8-khz MULAW that will work as a telephony prompt. Using techniques found in the library authors documentation and some stack overflow posts and specifically following suggestion to do a 2 step conversion.
...ANSWER
Answered 2019-Jan-07 at 21:03Figured it out myself, issue was I needed to be using one of the other options to resample the audio vs. just using WaveFormatConversionStream. After resampling with MediaFoundationResampler the audio quality was much improved over what I was getting with ACM via WaveFormatConversionStream.
This doc helped me come to that realization...
QUESTION
I need to convert an audio file (any common format) into a rtp stream
saved in a .pcap
file with G.722
Codec.
The generated .pcap
file will be sent with SIPp using:
ANSWER
Answered 2018-Oct-23 at 12:04Steps to convert wav
audio to .pcap
file:
- Split audio to 20 ms chunks
- Encode each chunk with
G.722
encoder - Create RTP header for each encoded chunk
- Save RTP stream to
.pcap
I've never used SIPp, but if it can process encoded G.722
stream, then use ffmpeg for encoding:
QUESTION
I'm recording a wav file using GStreamer receiving G711 flow through a UDP port. Any wav player can play the file, but shows a wrong duration and cannot fast forward. I believe that GStreamer writes the header at the beginning with empty data.
This pipeline can reproduce the issue:
...ANSWER
Answered 2018-Jun-13 at 20:52How do you stop the pipeline? If you interrupt the pipeline with ctrl-c it may indeed be that the header finalization is skipped. Run your pipeline with the -e
option so that on ctrl-c your pipeline gets stopped gracefully.
QUESTION
Given a commandline ffmpeg -f lavfi -i "sine=frequency=1000:duration=5" -ar 8000 -c:a FOO pipe:1
, ffmpeg might complain it's "unable to find a suitable output format". For some codecs, ffmpeg has a default container format, e.g. -c:a libmp3lame
will produce MP3's. For other codecs, you just repeat yourself (sort of): -c:a pcm_alaw -f alaw
But what if I want to stream the raw codec output, and there's no matching -f
? Can I just take -f alaw
and assume that it doesn't do anything? (G711 alaw is a simple codec which produces a byte stream, so -f alaw
presumably just copies that byte stream)
Obviously the other side of the pipe needs to know how the data stream needs to be interpreted, if there's no container info. But assume that I already know the other side of the pipe is expecting an audio stream, sampled at 8 kHz, encoded with -c:a FOO
.
ANSWER
Answered 2017-Apr-18 at 16:25I presume by 'raw' you meant uncompressed audio samples (PCM).
In additional to alaw
, ffmpeg
supports other variations of PCM formats.
QUESTION
I have to write a program that solves the 7-11 problem (if you don't know what this is, Google will explain) but instead of finding the values that add and multiply to make $7.11, I have to find all the unique values of a, b, c and d that add and multiply to make $x.yz between $1.00 and $9.99.
It gets to the if statement where it checks if a, b, c and d multiply to make n but it is never true.
...ANSWER
Answered 2017-Mar-11 at 08:15This can be simplified using itertools.combinations_with_replacement
:
QUESTION
I am writing a program which should get sound from a pulseaudio source. I took pacat.c
source file as an example.
Some of functions are declared in /pulsecore/*.h
I include them into my source code:
#include
#include
#include
#include
#include
But compiler can't find them.
fatal error: pulsecore/log.h: No such file or directory
I build pulseaudio 9.0 with Yocto.
In /$BUILDSDIR/pulseaudio/9.0-r0/image there are no such headers. But they exist in pulseaudio source code and also there
/pulseaudio/9.0-r0/package/usr/src/debug/pulseaudio/9.0-r0/pulseaudio-9.0/src/pulsecore/
Is there any special option for pulseaduio to configure to copy headers into image? Or I should update yocto recipe to copy desired files?
...ANSWER
Answered 2017-Jan-27 at 22:19If you check the $WORKDIR of pulseaudio you will find the folder packages-split containing each package and its content.
I am not sure whether what you try is possible, but the files you are trying to use are provided in the package pulseaudio-dbg. Which you could try yo install either via image recipe or in your local.conf. (IMAGE_INSTALL or CORE_IMAGE_EXTRA_INSTALL variables respectively)
You can find the package itself in $WORKDIR/deploy-[rpm|ipk|deb]/
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install g711
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page