473,382 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Circular Audio Files

Hi,

I want to save an audio stream into a circular file so that I only keep say
the last hour's audio.

Can anybody help?

Cheers,
Quentin

Oct 13 '06 #1
6 1974
Hmm.
Well the first thing you need to be able to do is to save the audio stream
to a file. Assuming that you have succeeded in that, then you would need to
figure out a way to chop off the last portion of the file,and append to the
front of it in "chunks" of X minutes worth of audio.

Unfortunately, there isn't any kind of "circular file" that I know of, you'd
have to do it by periodically replacing the file contents.

Much of the difficulty revolves around the codec being used. For example, if
its a WAV file, there needs to be a WAV header at the beginning (usually the
first 44 bytes) in which the audio length and properties are specified.

Similar for WMV, ASF, RM etc. files.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Quentin" wrote:
Hi,

I want to save an audio stream into a circular file so that I only keep say
the last hour's audio.

Can anybody help?

Cheers,
Quentin

Oct 13 '06 #2
Hmm.
Well the first thing you need to be able to do is to save the audio stream
to a file. Assuming that you have succeeded in that, then you would need to
figure out a way to chop off the last portion of the file,and append to the
front of it in "chunks" of X minutes worth of audio.

Unfortunately, there isn't any kind of "circular file" that I know of, you'd
have to do it by periodically replacing the file contents.

Much of the difficulty revolves around the codec being used. For example, if
its a WAV file, there needs to be a WAV header at the beginning (usually the
first 44 bytes) in which the audio length and properties are specified.

Similar for WMV, ASF, RM etc. files.

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Quentin" wrote:
Hi,

I want to save an audio stream into a circular file so that I only keep say
the last hour's audio.

Can anybody help?

Cheers,
Quentin

Oct 13 '06 #3
Hmm.
Well the first thing you need to be able to do is to save the audio stream
to a file. Assuming that you have succeeded in that, then you would need to
figure out a way to chop off the last portion of the file,and append to the
front of it in "chunks" of X minutes worth of audio.

Unfortunately, there isn't any kind of "circular file" that I know of, you'd
have to do it by periodically replacing the file contents.

Much of the difficulty revolves around the codec being used. For example, if
its a WAV file, there needs to be a WAV header at the beginning (usually the
first 44 bytes) in which the audio length and properties are specified.

Similar for WMV, ASF, RM etc. files.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Quentin" wrote:
Hi,

I want to save an audio stream into a circular file so that I only keep say
the last hour's audio.

Can anybody help?

Cheers,
Quentin

Oct 13 '06 #4
Thanks Peter,

My thinking thus far is to save it in 1 second chunks. I've worked with
circular text files before where it is easy because the data is already
broken up into lines, but the audio part is a bit above me now, which is a
nice challenge.

I'll keep investigating.

Quentin

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.comwrote in message
news:A4**********************************@microsof t.com...
Hmm.
Well the first thing you need to be able to do is to save the audio stream
to a file. Assuming that you have succeeded in that, then you would need
to
figure out a way to chop off the last portion of the file,and append to
the
front of it in "chunks" of X minutes worth of audio.

Unfortunately, there isn't any kind of "circular file" that I know of,
you'd
have to do it by periodically replacing the file contents.

Much of the difficulty revolves around the codec being used. For example,
if
its a WAV file, there needs to be a WAV header at the beginning (usually
the
first 44 bytes) in which the audio length and properties are specified.

Similar for WMV, ASF, RM etc. files.

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Quentin" wrote:
Hi,

I want to save an audio stream into a circular file so that I only keep
say
the last hour's audio.

Can anybody help?

Cheers,
Quentin



Oct 13 '06 #5
"Quentin" <qu********@telkomsa.netwrote in
news:eg**********@ctb-nnrp2.saix.net:
Hi,

I want to save an audio stream into a circular file so that I only
keep say the last hour's audio.

Can anybody help?
Not sure if this will help, but take a look at:

http://www.un4seen.com/

BASS has custom audio streaming - so as long as your stream is circular...
you can loop your files : )
Oct 13 '06 #6
Spam Catcher <sp**********@rogers.comwrote in
news:Xn**********************************@127.0.0. 1:
"Quentin" <qu********@telkomsa.netwrote in
news:eg**********@ctb-nnrp2.saix.net:
>Hi,

I want to save an audio stream into a circular file so that I only
keep say the last hour's audio.

Can anybody help?

Not sure if this will help, but take a look at:

http://www.un4seen.com/

BASS has custom audio streaming - so as long as your stream is
circular... you can loop your files : )

I looked over the BASS API... and I think it can do what you want.

During recording, there is a CallBack Handler. One of the parameters is an
array of Bytes (PCM format). Being PCM, you should be able to just loop
your byte array (or file) over and over. there might be a hiccup where the
file over laps, but additional code can probably take care of that : )
Oct 13 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Rajesh Kapur | last post by:
Hello All, We are building an application that will dynamically choose and pre-pend short underwriting messages to the audio streamed over the web. We will use SMIL files. We need to decide if...
16
by: Kiuhnm | last post by:
Is there an elegant way to deal with semi-circular definitions? Semi-circular definition: A { B }; B { *A }; Circular reference: A { *B }; B { *A }; The problems arise when there are more...
8
by: fuliopen | last post by:
I like to create some audio files for my web site. These are all language files to help the visitor learn a foreign language. There is no music. As far as I know, I can create three types of...
2
by: ViperCB | last post by:
Hello from a newbie, I am trying to do some research on an upcoming project that involves reading in audio files of various formats and using the audio signal as a source of noise to generate...
4
by: Gary Morrison | last post by:
I need to create a lot of fairly-short audio files from the concatenation of a lot of even shorter audio files. I'd like to control that from a Perl script. The audio files would presumably be...
2
by: hzgt9b | last post by:
Using VS2003, VB.NET, BACKGROUND I have a window forms based application that will be distributed and executed directly from CD media. The app contains a TreeView control and a WebBroswer...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
0
by: universe | last post by:
hi friends, I am developing a webapplication (using ASP.NET 2.0). In that I need to play audio file in the following scenario. Case 1: Only one file will be given as input to audio...
1
Dököll
by: Dököll | last post by:
Greetings, Good buddies! I am for the first time, since I started learning VB, going to build an application I wanted to build for my first son, a language and activities program that will allow...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.