473,770 Members | 4,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1996
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*******@yaho o.nospammin.com wrote in message
news:A4******** *************** ***********@mic rosoft.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********@tel komsa.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**********@r ogers.comwrote in
news:Xn******** *************** ***********@127 .0.0.1:
"Quentin" <qu********@tel komsa.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
10027
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 the short underwriting messages are better off stored in a the database (BLOB field?) or in a physical file with the references stored in the database. How can we load the audio from a physical file to the database? Is it a good idea to store...
16
2839
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 semi-circular definitions and
8
2775
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 such files: .wav, .mp3 and .wma. But my knowledge may be too old. Is there any new type? I've seen an indicator for audio files in some language-learning pages. It is a small trumpet. Clicking it would play the sound file. Is this small...
2
2627
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 pretty pictures. (like windows media player visual plugins. I will be developing in C++ and was wondering if there are any packaged libraries out there that I can use to read audio files encoded in different formats and lets me easily access the...
4
6058
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 AIFF or WAV files, preferable AIFF. Do any of you know of Perl commands to accomplish this? Specifically, * A call to create and open a new, empty AIFF or WAV file, * A call to append onto the end of that open audio file the audio content of...
2
7892
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 (AxSHDocVw.AxWebBrowse) control. The TreeView is populated with nodes that when clicked play an audio clip that is stored on the CD and navigate the browser control to a specified web URL (also stored on the CD). All the web URLs are html documents...
13
4901
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, suggestions or improvements? if( wmv file) document.write("<OBJECT id=Player classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 height="354" width="479">
0
1706
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 device.Untill the user presses ALT+F4 it should continue playing. Case 2: more than one Audio file will be given as I/P to audio device. They will be placed in cue, so one after one they will be played. Here, if the user presses ALT+F4 the playing should be...
1
2189
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 at one push of a button for colours to be added in squares, circles, and for audio responses to these to sound when for example, red circles, blue squares, or foods, etc are found in text added to multiline textbox. My second son can benefit from...
0
9439
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10071
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9882
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3987
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2832
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.