Recent

Author Topic: Audio streaming  (Read 10675 times)

aljgardin

  • Newbie
  • Posts: 5
Audio streaming
« on: January 07, 2017, 10:53:56 pm »
Looking for information on how to stream audio between two computers.

Sound is input at computer one through the microphone jack,
sound is output at computer two through the headphone jack.
Both computers are on same network.
Would also like to be able to stream over internet from computer one to computer two.

Using Latest Lazarus.  Windows XP.  Old but works.
« Last Edit: January 11, 2017, 05:00:11 am by aljgardin »

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Audio streaming
« Reply #1 on: January 09, 2017, 01:11:41 pm »
This shouldn't be a complex task:

You need a library to play and record sound.  Right now I think in Allegro or SDL, but they're not "sound" libraries but game libraries.  I can't remember any specific "sound" library.  Anyway it should work with Allegro or SDL.

For net streaming, use any net library as Indy or Synapse.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Audio streaming
« Reply #2 on: January 09, 2017, 02:18:10 pm »
Hello.

With uos (https://github.com/fredvs/uos) it should be possible.

For input computer, use AddFromDevIce().
For output computer, use AddFromURL().

Fre;D


I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

turrican

  • Full Member
  • ***
  • Posts: 133
  • Pascal is my life.
    • Homepage
Re: Audio streaming
« Reply #3 on: January 11, 2017, 09:26:17 pm »
Hi,

I suggest you to use BASS Library has Delphi and FPC .pas units for Windows and Linux compatibility : http://www.un4seen.com/

If you are developing for windows it's very easy to stream audio buffers from WASAPI. If you are using Linux you have to use OpenAL or ALSA.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1186
    • Burdjia
Re: Audio streaming
« Reply #4 on: January 12, 2017, 12:39:16 pm »
I should take a look a that site.  I see some MIDI stuff in there.  :)
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Audio streaming
« Reply #5 on: January 12, 2017, 01:58:51 pm »
I should take a look a that site.  I see some MIDI stuff in there.  :)

Indeed, Bass is a great library but ... not open-source and free only for no-commercial work.
« Last Edit: January 12, 2017, 02:03:07 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

mig-31

  • Sr. Member
  • ****
  • Posts: 305
Re: Audio streaming
« Reply #6 on: January 12, 2017, 02:07:52 pm »
When you replace Windows XP with Linux, you can do it very simply with pulseaudio (a part of all linux distribution). There are a lot of tutorials in the web.
Lazarus 2.2.6 - OpenSuse Leap 15.4, Mageia 8, CentOS 7

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: Audio streaming
« Reply #7 on: January 12, 2017, 04:05:51 pm »
When you replace Windows XP with Linux, you can do it very simply with pulseaudio (a part of all linux distribution). There are a lot of tutorials in the web.
There are Windows solutions to that too, such as Skype. But it sounds like this thread is about making such by oneself.

You might want to compress the audio for sending too?

turrican

  • Full Member
  • ***
  • Posts: 133
  • Pascal is my life.
    • Homepage
Re: Audio streaming
« Reply #8 on: January 12, 2017, 08:53:17 pm »
With Bass you can do whatever you want. Some time ago I developed a program to recording (ALL-YOU-HEAR Input/Output) CrossFade these signals and send it to an endpoint over TCP-IP stack.

Options for Windows Win32 & Win64 : DirectSound, ASIO, WASAPI, WaveOUT, MIDI.
Options for Linux I386 & x86-64 and ARM : More or less the same.

You can use BASS for not comercial apps.  ;D


mig-31

  • Sr. Member
  • ****
  • Posts: 305
Re: Audio streaming
« Reply #9 on: January 13, 2017, 01:24:06 pm »
When you replace Windows XP with Linux, you can do it very simply with pulseaudio (a part of all linux distribution). There are a lot of tutorials in the web.
There are Windows solutions to that too, such as Skype. But it sounds like this thread is about making such by oneself.

But when he switch to Linux, he can set it out of box.
« Last Edit: January 13, 2017, 04:27:37 pm by mig-31 »
Lazarus 2.2.6 - OpenSuse Leap 15.4, Mageia 8, CentOS 7

serbod

  • Full Member
  • ***
  • Posts: 142
Re: Audio streaming
« Reply #10 on: January 13, 2017, 01:48:56 pm »
With ACS components and any network components with TStream support you can build pipelines:
TAcsAudioIn -> TAcsStreamOut -> TMemoryStream -> TCP Socket
and
TCP Socket -> TMemoryStream -> TAcsStreamIn ->TAcsAudioOut

 

TinyPortal © 2005-2018