Opening MP3 files with text editors [closed] - python-2.7

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I have a question:
When I open an mp3 file with a text editor(sublime text), a few hundred thousand numbers in 4 digits appear(like picture below).
I got curious and experimented, deleting sections of the file and playing the mp3 file.
When I deleted the first parts, the music played but the file's CD artwork disappeared. When I deleted a huge chunk of the middle section, the music played but was shortened, with the middle part of the song gone.
Do you know what each part of the picture-letter combination represents?
I want to manipulate mp3 files(slow them down, lower the pitch, etc.) with python by modifying these numbers.
Do you have any insight on this, or what I can google to further explore?
Thanks!

This are hex values and represents how the bytes in you mp3 are laid out in memory. To manipulate them you can think of some ideas of your own for example if you just want to slow the mp3 down you can just copy each hex value and repeat them adjacent to each other. This will result in program reading the same value for a longer time and thus slowing down the tempo. The more copies you make the slower the music will play. Making the music fast requires deleting alternate bytes. Likewise you can think of more ways to manipulate these hex values. For example you can add echo, cancel noise in an audio however I don't know how that's done.

I would suggest looking at an MP3 file structure specification. Each MP3 file is composed of multiple frames and tags. Those hex values you are looking at hold the content for each frame. Modifying each frame will allow you to adjust the sampling rate and bitrate.
For more in-depth information on the MP3 specification, I would take a look at
http://www.multiweb.cz/twoinches/mp3inside.htm

Related

How do I make PlaySound load only some parts of the song C++ [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have a 424 mb wav file, which I want to play, but it takes a lot of time to load, and it uses 425.6 mb of ram. Way too much ram for a dos format program. I want to load only a part of the song, then when it's almost at the final, load the second part, when the second part is played, remove from ram the first part, and etc. For this I should use 50 parts.
Here is the line of code:
PlaySound("../music/main.wav", NULL, SND_FILENAME|SND_LOOP|SND_ASYNC);
I mention that I need to run this in background, while the other commands do their roles.
PlaySound is a fairly high-level function, so it's tricky to get behavior like this. In particular, you will likely experience small silent gaps between playing back the different parts. So the best solution would be to go to a lower-level API that allows more sophisticated managing of sound playback buffers. OpenAL is a good library for doing this, the modern Windows native solution is WASAPI, which unfortunately is quite complicated to use.
With PlaySound itself, first adjust your program to load the .wav file to memory and then use SND_MEMORY for playing it from memory (example).
Now, instead of loading the whole .wav file at once, you just load the header and as many soundframes as fill your buffer. You then create your own .wav header for just those loaded samples and put it all in a contiguous buffer. You basically build your own, smaller .wav file in memory. Then you call PlaySound(..., SND_MEMORY) on that buffer. Rinse and repeat for the remaining samples from the original file.
Note that you will need your own .wav file format parser for this, but the file format is not that complicated, so hopefully this should not be too much of an issue.

c++ creating 1 video from multiple video files [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I need to write a program that is a television like.
I will need to create 1 video form
e.g. 4 video files (lets say first video should be in top-left corner, second in top-right corner of the stream, etc.).
Also I'll need to add some scrolling text to the video and so on and so on...
So, the question is,
if there are any libs that could help me with that?
Thank you.
You question missed many details. Do you write cross-platform program? Or should it work on Windows or *nix only? Also do you have unlimited budget for possible libraries? Or are you looking for open source libraries? So...
From common sense you could use FFMPEG library which is crossplatform. If you can use Windows platform than you could use Avisynth, it provides really powerful scripting mechanism that allows you to combine multiple videos into one and you could add your own filters that add watermark or other kind of effects
Not sure about libraries, and you also haven't mentioned the format of the video input files (I'll presume they are in a compressed format like H.264 since if they are raw that is just a subset), but I would need to do shis on Windows, I'd do the following:
1) Read and decoded the frames from the input files (either with FFMPEG or VFW) an then put the encoded data in a larger bitmap with the resulting size of the 4 screens
2) Since now it is a raw bitmap apply the text or whatever is needed using e.g. DrawText(http://msdn.microsoft.com/en-us/library/windows/desktop/dd162498(v=vs.85).aspx), to ease the use of WinAPI you could use some GDI wrapper library.
I guess one of the main pitfalls here is to properly synchronize the presentation times of the frames from different files, since they can all have different fps and time breaks so you can't just read frame by frame but you need to keep track which frame from which file is supposed to be presented at each step when applying the transformations you need.

How to extract plain text from MS word document file in pure C++? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Is there any pure C++ library to extract plain text from a .doc file?
I'm developing a C++ program to read .doc and .pdf files. I have to extract plain text from the file and write it into a .txt file.
You could have a look at the open source C library used by Abiword, wv.
You can also call out to a batch convert tool
Open source batch converter, based on OpenOffice: http://dag.wieers.com/home-made/unoconv/
The open source for unix: http://www.wagner.pp.ru/~vitus/software/catdoc/
Proprietary for windows: http://doc2txt.com/. Note I havn't tried this one.
If you want to manipulate/read .doc files, you can just take the time and learn the format and manipulate the .doc file manually. You can get it at the MSDN page linking to the format-specification (PDF file).
I admit, it's quite a bit of reading to do, but if you're looking to create software to manipulate/read files, you should have the relevant underlying knowledge to back it all up.
Same goes for the pdf format (which is an open format, and as such specifications should be easy to find).
For doc - Use the Word object model to get to the the document and extract the text. This example uses OLE Automation and C . Another link for DOCX that might help you.
For PDF - Use Haru .
You could always use OIVT (OutsideIn Viewer Technology, I think) now owned by oracle.
I'll be honest, it's not a cheap solution, and while this product is to allow you view, print, etc... I think if i remember correctly, they do offer an option to extract the content to text or they another product that does that. it can do this from pretty much any document type including doc, docx, pdf (just to name a few) without having to use the "original" application installed as they have their own set of filters.
Here's a link to get you started
Outside In Viewer Technolog
Good luck

Creating csv files in ObjC [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Is it possible or any library available for creating .csv file in ObjC ?
Thanks
A CSV file is a text file of comma seperated values.
You could write an a routine that loops through values adding each one to a text file (or even add the values to a string?). After each field, add the ',' character. At the end of each row, add a new line. The first row can be the field titles.
E.g.
Year,Make,Model
1997,Ford,E350
2000,Mercury,Cougar
Here is a wikipedia article that describes what CSV is. I hope it can help.
CSV files are very simple.
If the data for each row is held in an array you could use -NSArray componentsJoinedByString:to create a row for the CSV file. You'd also have to escape the text but that's shouldn't be too tricky. All that's left is appending the row to a file.
You may also like to read Writing a parser using NSScanner (a CSV parsing example), which explains how to read a CSV file.
Take a look at chcsvparser.
NSArray has some functionality that can accomplish at least some of this (depending on whether or not you need to escape characters) pretty readily. Take a look at the componentsJoinedByString: method.
NSString has a partner method - componentsSeparatedByString:

ppt/pptx converter to html or other format [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm just wondering if anybody knows an open source project devoted to convert ppt (or pptx) file to an easy-to-render format - html, jpg or other picture type, pdf...
I've developed some code to start reading an office file (I'm talking about the Compound Binary File) and now I've started to crack on the internal ppt streams like Picture and PowerPoint document. But each stream, as many of you know, it's huge, and write code to render it is a massive job. So, if anybody knows an Open Source project that reads and export it to an easier file to render, (must be in C++ or C - could be in C#, java since it doesn't use any API/lib facility)
Please, don't ask me why I'm doing this :-).
I really appreciate.
Powerpoint has an option to save as web-page or publish as web-page. It can be found under the file menu. You could also look into using the following which supposedly gives more control of layout: pp2html
The applications in the KOffice 2.x suite are easily scripted to output PDF, and ImageMagick can be utilized to split a PDF into pages if desired.
$ kpresenter --export-pdf --export-filename output.pdf input.ppt
Loading file /home/ephemient/input.ppt
UserEditAtom
LastSlideID 256
MajorVersion 768
MinorVersion 3516
Offset Last Edit 0
Offset Persist Dir 151466
Document Ref 1
/home/ephemient/input.ppt loaded. Done.
$ convert output.pdf page.png
$ ls -1v
input.ppt
output.pdf
page-1.png
page-2.png
page-3.png
...
Have you tried NPOI?
Best