audio-streaming

Node - Can't seek audio stream

假装没事ソ 提交于 2019-11-30 09:24:52
I have created a simple server that uses the fs module to stream an mp3 file to a browser which plays it in an html5 audio element. As it is, the audio streams perfectly fine, however, I can't seek through the stream, even if the part I seek to has already been buffered. var express = require('express'); var app = express(); var fs = require('fs'); app.get('/', function (req, res) { var filePath = 'music.mp3'; var stat = fs.statSync(filePath); res.writeHead(200, { 'Content-Type': 'audio/mpeg', 'Content-Length': stat.size, }); var readStream = fs.createReadStream(filePath); readStream.pipe(res)

Choppy/inaudible playback with chunked audio through Web Audio API

做~自己de王妃 提交于 2019-11-30 09:23:28
I brought this up in my last post but since it was off topic from the original question I'm posting it separately. I'm having trouble with getting my transmitted audio to play back through Web Audio the same way it would sound in a media player. I have tried 2 different transmission protocols, binaryjs and socketio, and neither make a difference when trying to play through Web Audio. To rule out the transportation of the audio data being the issue I created an example that sends the data back to the server after it's received from the client and dumps the return to stdout. Piping that into VLC

PHP script to extract artist & title from Shoutcast/Icecast stream

帅比萌擦擦* 提交于 2019-11-30 07:23:45
I found a script which can extract the artist & title name from an Icecast or Shoutcast stream. I want the script to update automatically when a song changed, at the moment its working only when i execute it. I'm new to PHP so any help will be appreciated. Thanks! define('CRLF', "\r\n"); class streaminfo{ public $valid = false; public $useragent = 'Winamp 2.81'; protected $headers = array(); protected $metadata = array(); public function __construct($location){ $errno = $errstr = ''; $t = parse_url($location); $sock = fsockopen($t['host'], $t['port'], $errno, $errstr, 5); $path = isset($t[

Record streaming and saving internet radio in python

心已入冬 提交于 2019-11-30 07:09:24
I am looking for a python snippet to read an internet radio stream(.asx, .pls etc) and save it to a file. The final project is cron'ed script that will record an hour or two of internet radio and then transfer it to my phone for playback during my commute. (3g is kind of spotty along my commute) any snippits or pointers are welcome. The following has worked for me using the requests library to handle the http request. import requests stream_url = 'http://your-stream-source.com/stream' r = requests.get(stream_url, stream=True) with open('stream.mp3', 'wb') as f: try: for block in r.iter_content

How to Call SPEEX Audio Decode/Encode in HTML5 / JavaScript (Without Flash)

一笑奈何 提交于 2019-11-30 07:06:10
I'm working on a project that requires audio data to be streamed via HTTP to/from server. We need to compress the audio data using SPEEX. In Flash, we can use Alchemy and LibSpeex, but how can we do it in JavaScript. HTML5 can be used. Thanks. Peter I recently implemented a successful HTML5/VOIP client using the following JS port of Speex, truly awesome stuff: https://github.com/jpemartins/speex.js For now you'll need to either wait for MediaStreamRecorder or jump the gun like I did, and make use of this: https://github.com/jwagener/recorder.js/ As for how you piece the whole lot together into

Java - Broadcast voice over Java sockets

£可爱£侵袭症+ 提交于 2019-11-30 04:05:29
I have created a Server app that receives sound from client, i then broadcast this sound which is stored as bytes and send the bytes back to the clients that are connected to the server. now i am only using one client at the moment for testing and the client is receiving the voice back but the sound is stuttering all the time. Could some one please tell me what i am doing wrong? I think i understand some part of why the sound isn't playing smoothly but don't understand how to fix the problem. the code is bellow. The Client: The part that sends the voice to server public void captureAudio() {

How to stop IDM from grabbing video/audio [closed]

妖精的绣舞 提交于 2019-11-30 02:58:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Every time a video/audio streaming starts the Internet Download Manager (IDM) feels that there is a multimedia content on the page and allows you to download that multimedia content. I don't think it's possible to prevent IDM from grabbing video/audio but is there a way to fool IDM to get a wrong video instead

Sending audio stream over TCP, UnsupportedAudioFileException

为君一笑 提交于 2019-11-30 02:57:43
问题 I have succeeded with sending and reading text and images data over TCP sockets. But I am unable to sending and reading audio stream data. sample code at server: public class ServerAudio { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub try { ServerSocket serverSocker = new ServerSocket(); Socket client = null; serverSocker.bind(new InetSocketAddress(6666)); if (serverSocker.isBound()) { client = serverSocker.accept(); OutputStream out = client

How to prevent HTML5 audio from predownload / streaming on load?

拈花ヽ惹草 提交于 2019-11-30 02:45:14
I have a single page website which lists a collection of HTML5 audio players. The problem is the site has become slow because the following browsers start predownloading the content (mp3 and ogg) Internet Explorer Google Chrome Firefox Safari (probably Opera) I use the basic code to implement the players. Is there a way I can prevent the browsers from predownloading the audio files and only work when they click play? <audio controls="controls" height="32" width="300" tabindex="0"> <source type="audio/mpeg" src="http://cdn.com/track.mp3"></source> <source type="audio/ogg" src="http://cdn.com

Ice cast source client for ios

本秂侑毒 提交于 2019-11-29 23:47:32
问题 I have been trying to create a source client for ice cast for ios. I have been able to connect using asyncsocket to connect to the socket. I am also able to write data to the server. The icecast configuration is done for mp3 format. But the mp3 file written to the server is corrupt. I am providing some code snippets. Header: NSString *string = @"SOURCE /sync HTTP/1.0\r\n" "Authorization: Basic c291cmNlOmhhY2ttZQ==\r\n" "User-Agent: butt-0.1.12\r\n" "User-Agent: butt-0.1.12\r\n" "content-type: