EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / Try this for audio 1. Make

Try this for audio 1. Make

|

Microcontroller › Raspberry Pi › how to stream video and audio › Try this for audio 1. Make

February 27, 2019 at 2:57 pm #15028
Nikhil P.R.
Participant
Try this for audio
 
1. Make sure you compile against this implementation / version of ortp 
ortp-0.22.0.tar.gz
Get it from here : http://download.savannah.nongnu.org/rel … p/sources/
 
 
2. I changed the opus encoder / decoder to int16 from float – due to my audio devices was simple 
16 bit cheep stuf. 
changes to tx.c rx.c and device.c
 
 
jakobsen@w520:~/work/trx/trx-0.3$ diff rx.c /home/jakobsen/work/friaudio/pi_node/src/trx/rx.c 
73c73,74
< float *pcm;
—
> //float *pcm;
> opus_int16 *pcm;
79c80,81
< r = opus_decode_float(decoder, NULL, 0, pcm, samples, 1);
—
> r = opus_decode(decoder, NULL, 0, pcm, samples, 1);
> // r = opus_decode_float(decoder, NULL, 0, pcm, samples, 1);
81c83,84
< r = opus_decode_float(decoder, packet, len, pcm, samples, 0);
—
> r = opus_decode(decoder, packet, len, pcm, samples, 0);
> // r = opus_decode_float(decoder, packet, len, pcm, samples, 0);
241c244,245
< 
—
> 
> 
268a273
> 
 
jakobsen@w520:~/work/trx/trx-0.3$ diff tx.c /home/jakobsen/work/friaudio/pi_node/src/trx/tx.c 
63c63,64
< float *pcm;
—
> //float *pcm;
> opus_int16 *pcm;
91c92,93
< z = opus_encode_float(encoder, pcm, samples, packet, bytes_per_frame);
—
> z = opus_encode(encoder, pcm, samples, packet, bytes_per_frame);
> //z = opus_encode_float(encoder, pcm, samples, packet, bytes_per_frame);
245,246c247,248
 
jakobsen@w520:~/work/trx/trx-0.3$ diff device.c /home/jakobsen/work/friaudio/pi_node/src/trx/device.c 
56c56
< r = snd_pcm_hw_params_set_format(pcm, hw, SND_PCM_FORMAT_FLOAT);
—
> r = snd_pcm_hw_params_set_format(pcm, hw, SND_PCM_FORMAT_S16_LE); //SND_PCM_FORMAT_FLOAT);

RSS Recent Posts

  • Getting into an LED bulb April 21, 2026
  • understanding of resonance in time domain April 21, 2026
  • Beginner Questions About CNC Machines – G-code, Control Systems & Accuracy April 21, 2026
  • A Must-Watch Video Showing Dangerous Construction of Cheap Lithium-Ion Cells April 21, 2026
  • S1MJ ? April 20, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise