(Linux/Mac) find command - how to execute multiple commands to the same file before moving on to the next one?
Edit: My shell version is requested: zsh 5.7.1 (x86_64-apple-darwin18.2.0)
I'm on Mac, but this is a Linux command (find
) I'm using in terminal.
So my overall goal is already somewhat reached, but I'm wanting to make it cleaner/more efficient and have less problems.
I'm converting a bunch of .wav and .aif files in several sorted directories to .flac using:
find . -type f -name "*.aiff" -exec flac -8 "{}" \; && find . -type f -name "*.aiff" -exec rm "{}" \; && find . -type f -name "*.wav" -exec flac -8 "{}" \; && find . -type f -name "*.wav" -exec rm "{}" \;
(convert.sh)
Which works, if I'm not continuing work in the directory. Doing so produces more .wav and .aif files that end up being deleted without being converted since I produce them during conversion, and find
isn't looking for more wavs to convert after the first part of code is executed, only for wavs to delete.
I've tried using && with find
- for example:
find . -type f -name "*.wav" -exec flac -8 "{}" && rm "{}" \;
However that seems to think after && is a new command, not part of the same command I want to execute, and gives error find: -exec: no terminating ";" or "+"
.
(Potential Solution) I know I could somehow use a .sh file but I don't know how to set it up so that it works like /path/to/convertanddeletebeforenextfile.sh /path/to/filetoconvert.wav
to be able to use find . -type f -name "*.wav" -exec /path/to/convertanddeletebeforenextfile.sh "{}" \;
Could someone help me with this final straight to the point goal:
Convert .wav/.aif to .flac and delete original, then move to next .wav/.aif
See also questions close to this topic
-
Reset Root Password MySQL on Ubuntu
I know there are tons of posts about this on here but nothing seems to work. I have tried every command I could find it will not work.
I just recently setup mysql on Ubuntu (SQL version is 8.0.23-0ubuntu0.20.04.1). Afterwards i installed myphpadmin and I can get to it, but I noticed that it said that root doesn't have a password, even though I set one in the mysql_secure_installation. I don't really want to go any farther until i get a password on root, as eventually i'm going to have this server exposed to the outside, but every single command I have tried seems to do nothing. I am testing if it is working by entering "sudo mysql -u root" with no password and i'm assuming if there is a root password set then it will prompt for one instead of just going straight into the mysql> prompt.
These are the commands that i've tried:
mysql> UPDATE mysql.user SET Password=PASSWORD('newpassword'); RESULT: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('newpassword')' at line 1 mysql> SET PASSWORD = PASSWORD('newpassword'); RESULT: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PASSWORD('newpassword')' at line 1 mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword'; RESULT: Query OK, 0 rows affect (0.01 sec)
Seeing this made me think its working, so i ran FLUSH PRIVILEGES; and refreshed myphpadmin but it still shows that it doesn't have password, so i kept going.
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpassword'); RESULT: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PASSWORD('newpassword')' at line 1 shell> sudo mysqladmin -u root password New password: newpassword Confirm new password: newpassword RESULT: Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
This one seems like the right path maybe? But it says i need SSL...which is weird because i'm on the computer in a terminal, i don't know how to do an ssl connection to mysqladmin on the same computer using the terminal.
shell> sudo mysql_secure_installation RESULT: Success. All done!
This acts like it works, but it does nothing
Change from myphpadmin: I tried changing it from myphpadmin as well, it goes through with no issues, but the password still seems to be the same.
mysql> UPDATE user SET authentication_string=PASSWORD('newpassword') WHERE User='root'; RESULT: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('newpassword')' at line 1
There was also mention of getting the first root login from /var/log/mysqld.log, but that doesn't exist on my computer
There are probably a few other odd things here and there i've tried but nothing has worked, does anyone have any insight into this?
-
Communicate two child fork processes with FIFO
I made this program with pipes to communicate two processes with
PIPES
. Now what I have to do is the same but withFIFO
.#include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <wait.h> #include <string.h> int main() { int e, p[20], hijo1, hijo2, nbytes, readbytes; char texto[200], readbuffer[100]; printf("Write the message to send to the other process\n"); fgets(texto, 100, stdin); pipe(p); if ((hijo1 = fork()) == -1) { printf("ERROR FORK\n"); exit(EXIT_FAILURE); } if (hijo1 == 0) { printf("Im %d and Im child 1\n", getpid()); close(p[0]); write(p[1], texto, strlen(texto + 1)); close(p[1]); exit(0); } if ((hijo2 = fork()) == -1) { printf("ERROR FORK\n"); exit(EXIT_FAILURE); } if (hijo2 == 0) { printf("Im %d And Im child 2 \n", getpid()); close(p[1]); write(1, "message received: ", 24); while ((nbytes = read(p[0], readbuffer, 8)) == 8) { write(1, readbuffer, nbytes); } write(1, readbuffer, nbytes); printf("\n"); close(p[0]); exit(0); } printf("Im %d and Im the father\n", getpid()); waitpid(hijo1, &e, 0); waitpid(hijo2, &e, 0); exit(EXIT_SUCCESS); }
This is what I tried to do but with FIFO
#include <stdio.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> #include <stdlib.h> #include <wait.h> #include <string.h> int main() { char texto[200], buf[200]; int fd, fd2, hijo1, hijo2, nbytes; printf("Ingrese el mensaje para enviar al FIFO\n"); fgets(texto, 100, stdin); printf("soy %d y soy el padre \n", getpid()); mkfifo("/tmp/mi_fifo", 0666); if ((hijo1 = fork()) == -1) { printf("ERROR FORK\n"); exit(EXIT_FAILURE); } if (hijo1 == 0) { printf("soy %d y soy el hijo 1 \n", getpid()); fd = open("/tmp/mi_fifo", O_WRONLY); write(fd, texto, sizeof(texto + 1)); close(fd); exit(0); } if ((hijo2 = fork()) == -1) { printf("ERROR FORK\n"); exit(EXIT_FAILURE); } if (hijo2 == 0) { printf("soy %d y soy el hijo 2 \n", getpid()); fd2 = open("/tmp/mi_fifo", O_RDONLY); write(1, "el mensaje recibido es: \n", 24); while (nbytes = read(fd2, buf, 8) == 8) { write(1, buf, nbytes); } write(1, buf, nbytes); close(fd2); exit(0); } return 0; }
This Fifo program is not receiving the Message from the other child process. When I print the
buf
variable withWrite()
It shows only one letter. It should show the whole message that's why it is in a while loop. How can I do that? I haven't found any information about fork processes and FIfOs I hope you can help me. -
How to use Qt QDir::mkdir or QFile() in root folders
I'm trying to use QDir to create a logging directory from my Qt application. I would like to place this directory in
/var/log
and essentially create a rotating logger. I believe that because of permissions, Qt cannot create any file or directory at the path /var/log. Is there a workaround for this? I would need to do something like so:if(!QDir("/var/log/qtlogger").exists()){ QDir().mkdir("/var/log/qtlogger"); }
-
How do you install QMK with the new Mac M1 (ARM) chip
I keep getting compiling errors whenever I follow the homebrew install guide for QMK.
==> Installing qmk from qmk/qmk avr-gcc@8: The x86_64 architecture is required for this software. Error: An unsatisfied requirement failed this build.
Not sure how to get this to install correctly.
-
macOS Time Announcements -- speak a longer phrase
In macOS (Big Sur), ever since I did:
defaults write ./com.apple.speech.synthesis.general.prefs TimeAnnouncementPrefs -dict u -bool YES
the system announces the time as, say "four-thirty," whereas it used to announce the time as "It's four-thirty" (with the word "it's").
Here's the prefs structure:
{ TimeAnnouncementsEnabled = 1; TimeAnnouncementsIntervalIdentifier = EveryQuarterHourInterval; TimeAnnouncementsPhraseIdentifier = ShortTime; TimeAnnouncementsVoiceSettings = { CustomVolume = "0.2046729"; }; }
How do I get back the "it's" word? I think it has to do with
TimeAnnouncementsPhraseIdentifier
(which is sometimes missing). -
Nativescript + Angular: Unable to start cleanup process error when running 'tns run android'
I am building a project in Nativescript + Angular on macOS Big Sur. I am unable to run or build the android version of the project. I keep getting this error:
Error while reporting exception: Error: Unable to start Cleanup process.
Is anyone familiar with this error? I ran
tns clean
successfully as well astns platform remove android
,tns platform add android
,tns prepare android
, but if I runtns build android
ortns run android
I get the error above.Here is my package.json. Let me know if there are any files that would be useful to see.
{ "name": "@nativescript/template-hello-world-ng", "main": "main.js", "version": "7.0.8", "author": "NativeScript Team <oss@nativescript.org>", "description": "NativeScript Application", "license": "SEE LICENSE IN <your-license-filename>", "publishConfig": { "access": "public" }, "keywords": [ "nativescript", "mobile", "angular", "{N}", "template" ], "repository": "<fill-your-repository-here>", "bugs": { "url": "https://github.com/NativeScript/NativeScript/issues" }, "dependencies": { "@angular/animations": "~11.0.0", "@angular/common": "~11.0.0", "@angular/compiler": "~11.0.0", "@angular/core": "~11.0.0", "@angular/forms": "~11.0.0", "@angular/platform-browser": "~11.0.0", "@angular/platform-browser-dynamic": "~11.0.0", "@angular/router": "~11.0.0", "@nativescript-community/ui-chart": "^1.1.29", "@nativescript/angular": "~11.0.0", "@nativescript/core": "^7.3.0", "@nativescript/firebase": "^11.1.3", "@nativescript/theme": "~3.0.0", "nativescript": "^7.2.0", "nativescript-carousel": "^7.0.1", "nativescript-custom-bottomsheet": "^1.0.6", "nativescript-fontawesome": "^1.0.0", "nativescript-ngx-fonticon": "^7.0.0", "nativescript-ui-chart": "^8.0.2", "nativescript-ui-dataform": "^7.0.4", "reflect-metadata": "~0.1.12", "rxjs": "^6.6.0", "sass": "^1.32.7", "zone.js": "~0.11.1" }, "devDependencies": { "@angular/compiler-cli": "~11.0.0", "@nativescript/android": "7.0.1", "@nativescript/ios": "8.0.0", "@nativescript/types": "~7.0.0", "@nativescript/webpack": "~3.0.0", "@ngtools/webpack": "~11.0.0", "typescript": "^4.0.2" }, "gitHead": "41a7254d3bc134fd3c258761f3c6e1c3d54e6d41", "private": "true", "readme": "NativeScript Application" }
-
MongoDB: How to find records before a specific date?
I have multiple records containing this date
creationTime:2021-04-06T10:55:43.915+00:00
and this field is defined as Date in the model
creationTime: { type: Date, required: [true, 'Please fill creationTime'], },
Now I want to find records with
creationTime
before 2021-03-01 so inside https://cloud.mongodb.com/ (Atlas) in the criteria bar I tested{creationTime : { $date : "2021-04-06T10:55:43.915+00:00"}}
and I got the record I'm using as an example correctly. Now I want to retrieve records before this date so I tried
{creationTime : { $lt: { $date : "2021-04-06T10:55:43.915+00:00"}}}
But I got
QUERY RESULTS 0
and I'm pretty sure there are so many documents before this data. I also tried{creationTime : { $lt: "2021-04-06T10:55:43.915+00:00"}}
But also no result. How can I retrieve documents which have creationTime before "2021-04-01" ?
-
Python: Find string1 in file and start looking for first appearance of string2 from the line where string1 is located
I am trying to find string1 in the file and start looking for the first appearance of string2 from the line where string1 is located and modify/replace string2. And then continue the same process over the entire file
Example:
- ABCD string1
- AAA
- BBB
- CCC
- String2
- DDD
- ABCABC
- EEE
- FFF
- String2
- GGG
- XYZ string1
- DEF
- String2
- LLL
So here I am not interested in string2 located at line 10. I only want to replace string2 located at lines 5 and 14.
So far I'm able to do general find and replace with this but it modifies every appearance of string2
def replace(file):
for line in fileinput.input(file, inplace=1): if re.search("^.*string2.*$",line): line = line.replace('string2','NEW STRING') sys.stdout.write(line)
-
How to find urls that contain things that I want? (Python)
html = requests.get(url) html = html.text all_link = re.findall('<a class="market_listing_row_link" href="(.*?)" id=".*?">',html)
It was list here so I changed it to str to use re.findall
all_link = str(all_link) print(all_link) #And I have some links here like this:['https://url1', 'https://url2'] FN = re.findall("The word I want",all_link) print(FN)
So how do I get the whole link? If I do this I will only get the "The word I want" The language I use is python.
-
Gimp: How to batch resize ONE image in multiple sizes and export them?
Is there any way to resize an image (jpg/ jpeg)on a range of predefined sizes and export at once on Gimp? (same image-different sizes batch scale and batch export).
Thank you!
-
how can i make a mysql batch update stored procedure?
So I wanted to create a stored procedure to update a batch of rows. I usually do this with looping the stored procedure in my code behind but this has some performance setback. My problem is how to pass the parameters to the query since the total number of rows to be changed varies.
This is my single row update stored procedure, how can I convert it to process more than 1 rows and how can I pass those rows as parameters?
DROP PROCEDURE IF EXISTS EditProductType; DELIMITER $$ CREATE PROCEDURE EditProductType( IN productTypeId INT, IN NAME VARCHAR(100), IN details VARCHAR(1000) ) BEGIN UPDATE product_types pt SET pt.name = NAME, pt.details = details WHERE pt.productTypeId = productTypeId; END$$ DELIMITER ;
-
Design system to consume kafka stream for daily/monthly reporting
I am working on data integration project where we need to consume kafka stream of business events but produce daily and monthly reports. We require some sort of state store for stream. The approach we brainstormed so far are : Use ktable to store events and let (one to many) consumers query data for further ETL processing Or Use key-value based (like dynamoDB) to dump events and let consumers use it.
We certainly don't want to own the events and storage should go away after reporting is done. I am a little concerned about the volume of data being stored for monthly processing because when I looked at kafka topic for a week worth of events, they are in the range of GBs.
I am relatively new to this problem space so would need help considering efficiency and scalability. Also, something which is not going to be anti pattern for future use cases.
-
Which is the "correct" content-type for FLAC?
Some software uses
audio/flac
. Some usesaudio/x-flac
.MDN suggests that
x-flac
is "non-standard". But based on what?But this appears to be the official registry for
audio/
types... andaudio/flac
doesn't appear on it. Has nobody ever registered flac there? Whyever not?In 2021, what is the correct place to determine the list of "standard" content-types, and what is it for FLAC?
-
ffmpeg conversion from Flac to Ogg produces corrupted files
i transcoded flac files to ogg using this command
ffmpeg -i input.flac -c:a libvorbis -b:a 500k output.ogg
yes i use 500k to keep the highest quality possible, some of the files are ok, but some of them can not be played - Unsupported format or corrupted file says the foobar - also my icecast streamer cant read it. So there is something wrong with the files.
I believed it was due to the high bitrate so I tried
ffmpeg -i input.flac -c:a libvorbis -b:a 320k output.ogg
the same happened, some files were ok, some were not playable. so I tried again with default using this command
ffmpeg -i input.flac -c:a libvorbis output.ogg
same thing. some files were ok, some were corrupted and not playable.
i have no clue why.
both flac and ogg are in the same family, what happened during the transcoding that it became a corrupted file?
the spectral analysis does not show anything wrong - here it the ogg https://prnt.sc/115zdjl, here is the original flac https://prnt.sc/115zegw
i am really interested what is going on and how to make it work?
can anyone explain?
here is complete log
C:\Users\lukas.kotatko>ffmpeg -i "\\192.168.0.128\lukas\online radio resources\Atma FM playlists\channel 1\flac lossless\Tuu\One Thousand Years\02 One Thousand Years.flac" -c:a libvorbis -b:a 500k "\\192.168.0.128\lukas\online radio resources\Atma FM playlists\channel 1\flac lossless\Tuu\One Thousand Years\02 One Thousand Years [500k test].ogg" ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 10.2.1 (GCC) 20200726 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf libavutil 56. 51.100 / 56. 51.100 libavcodec 58. 91.100 / 58. 91.100 libavformat 58. 45.100 / 58. 45.100 libavdevice 58. 10.100 / 58. 10.100 libavfilter 7. 85.100 / 7. 85.100 libswscale 5. 7.100 / 5. 7.100 libswresample 3. 7.100 / 3. 7.100 libpostproc 55. 7.100 / 55. 7.100 Input #0, flac, from '\\192.168.0.128\lukas\online radio resources\Atma FM playlists\channel 1\flac lossless\Tuu\One Thousand Years\02 One Thousand Years.flac': Metadata: GENRE : Tribal / Ambient ORGANIZATION : Waveform Records ISRC : 01101-2 COMMENT : US reissue featuring the six original tracks plus two taken from the Invocation album. MUSICBRAINZ_RELEASEGROUPID: 737d0518-3dc2-36b3-9419-282c0ade0e50 ORIGINALDATE : 1993 ORIGINALYEAR : 1993 RELEASETYPE : album MUSICBRAINZ_ALBUMID: f6339129-f662-43a1-93df-2f20540f73cc ALBUM : One Thousand Years BARCODE : 789060110125 MUSICBRAINZ_ALBUMARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad album_artist : Tuu ALBUMARTISTSORT : Tuu ASIN : B00005B9TT SCRIPT : Latn RELEASESTATUS : official LABEL : Waveform Records CATALOGNUMBER : 01101-2 RELEASECOUNTRY : US DATE : 2001-05-08 TOTALDISCS : 1 disc : 1 TOTALTRACKS : 8 MEDIA : CD MUSICBRAINZ_TRACKID: aef9824d-e4a6-4ae6-aebe-50a83dd14f71 TITLE : One Thousand Years MUSICBRAINZ_ARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad ARTIST : Tuu ARTISTSORT : Tuu ARTISTS : Tuu MUSICBRAINZ_RELEASETRACKID: 621c9da6-a85d-3f8b-b485-5e6f74a60cd0 track : 2 TRACKTOTAL : 8 DISCTOTAL : 1 Duration: 00:08:03.67, start: 0.000000, bitrate: 792 kb/s Stream #0:0: Audio: flac, 44100 Hz, stereo, s16 Stream #0:1: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 600x600 [SAR 1:1 DAR 1:1], 90k tbr, 90k tbn, 90k tbc (attached pic) Metadata: comment : Cover (front) Stream mapping: Stream #0:1 -> #0:0 (mjpeg (native) -> theora (libtheora)) Stream #0:0 -> #0:1 (flac (native) -> vorbis (libvorbis)) Press [q] to stop, [?] for help [swscaler @ 0000015307581a00] deprecated pixel format used, make sure you did set range correctly [ogg @ 00000153073f1680] Frame rate very high for a muxer not efficiently supporting it. Please consider specifying a lower framerate, a different muxer or -vsync 2 Output #0, ogg, to '\\192.168.0.128\lukas\online radio resources\Atma FM playlists\channel 1\flac lossless\Tuu\One Thousand Years\02 One Thousand Years [500k test].ogg': Metadata: GENRE : Tribal / Ambient ORGANIZATION : Waveform Records ISRC : 01101-2 COMMENT : US reissue featuring the six original tracks plus two taken from the Invocation album. MUSICBRAINZ_RELEASEGROUPID: 737d0518-3dc2-36b3-9419-282c0ade0e50 ORIGINALDATE : 1993 ORIGINALYEAR : 1993 RELEASETYPE : album MUSICBRAINZ_ALBUMID: f6339129-f662-43a1-93df-2f20540f73cc ALBUM : One Thousand Years BARCODE : 789060110125 MUSICBRAINZ_ALBUMARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad album_artist : Tuu ALBUMARTISTSORT : Tuu ASIN : B00005B9TT SCRIPT : Latn RELEASESTATUS : official LABEL : Waveform Records CATALOGNUMBER : 01101-2 RELEASECOUNTRY : US DATE : 2001-05-08 TOTALDISCS : 1 disc : 1 TOTALTRACKS : 8 MEDIA : CD MUSICBRAINZ_TRACKID: aef9824d-e4a6-4ae6-aebe-50a83dd14f71 TITLE : One Thousand Years MUSICBRAINZ_ARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad ARTIST : Tuu ARTISTSORT : Tuu ARTISTS : Tuu MUSICBRAINZ_RELEASETRACKID: 621c9da6-a85d-3f8b-b485-5e6f74a60cd0 track : 2 TRACKTOTAL : 8 DISCTOTAL : 1 encoder : Lavf58.45.100 Stream #0:0: Video: theora (libtheora), yuv420p(progressive), 600x600 [SAR 1:1 DAR 1:1], q=2-31, 200 kb/s, 90k fps, 90k tbn, 90k tbc (attached pic) Metadata: DESCRIPTION : Cover (front) encoder : Lavc58.91.100 libtheora GENRE : Tribal / Ambient ORGANIZATION : Waveform Records ISRC : 01101-2 MUSICBRAINZ_RELEASEGROUPID: 737d0518-3dc2-36b3-9419-282c0ade0e50 ORIGINALDATE : 1993 ORIGINALYEAR : 1993 RELEASETYPE : album MUSICBRAINZ_ALBUMID: f6339129-f662-43a1-93df-2f20540f73cc ALBUM : One Thousand Years BARCODE : 789060110125 MUSICBRAINZ_ALBUMARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad ALBUMARTIST : Tuu ALBUMARTISTSORT : Tuu ASIN : B00005B9TT SCRIPT : Latn RELEASESTATUS : official LABEL : Waveform Records CATALOGNUMBER : 01101-2 RELEASECOUNTRY : US DATE : 2001-05-08 TOTALDISCS : 1 DISCNUMBER : 1 TOTALTRACKS : 8 MEDIA : CD MUSICBRAINZ_TRACKID: aef9824d-e4a6-4ae6-aebe-50a83dd14f71 TITLE : One Thousand Years MUSICBRAINZ_ARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad ARTIST : Tuu ARTISTSORT : Tuu ARTISTS : Tuu MUSICBRAINZ_RELEASETRACKID: 621c9da6-a85d-3f8b-b485-5e6f74a60cd0 TRACKNUMBER : 2 TRACKTOTAL : 8 DISCTOTAL : 1 Stream #0:1: Audio: vorbis (libvorbis), 44100 Hz, stereo, fltp (16 bit), 500 kb/s Metadata: encoder : Lavc58.91.100 libvorbis GENRE : Tribal / Ambient ORGANIZATION : Waveform Records ISRC : 01101-2 DESCRIPTION : US reissue featuring the six original tracks plus two taken from the Invocation album. MUSICBRAINZ_RELEASEGROUPID: 737d0518-3dc2-36b3-9419-282c0ade0e50 ORIGINALDATE : 1993 ORIGINALYEAR : 1993 RELEASETYPE : album MUSICBRAINZ_ALBUMID: f6339129-f662-43a1-93df-2f20540f73cc ALBUM : One Thousand Years BARCODE : 789060110125 MUSICBRAINZ_ALBUMARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad ALBUMARTIST : Tuu ALBUMARTISTSORT : Tuu ASIN : B00005B9TT SCRIPT : Latn RELEASESTATUS : official LABEL : Waveform Records CATALOGNUMBER : 01101-2 RELEASECOUNTRY : US DATE : 2001-05-08 TOTALDISCS : 1 DISCNUMBER : 1 TOTALTRACKS : 8 MEDIA : CD MUSICBRAINZ_TRACKID: aef9824d-e4a6-4ae6-aebe-50a83dd14f71 TITLE : One Thousand Years MUSICBRAINZ_ARTISTID: e05a42e7-60a3-4d2d-983c-51dc4eb67cad ARTIST : Tuu ARTISTSORT : Tuu ARTISTS : Tuu MUSICBRAINZ_RELEASETRACKID: 621c9da6-a85d-3f8b-b485-5e6f74a60cd0 TRACKNUMBER : 2 TRACKTOTAL : 8 DISCTOTAL : 1 frame= 1 fps=0.1 q=-0.0 Lsize= 25860kB time=00:08:03.66 bitrate= 438.0kbits/s speed=44.6x video:8kB audio:25721kB subtitle:0kB other streams:0kB global headers:7kB muxing overhead: 0.511663%
-
Mixing .flac files in Python correctly
say I have two .flac files speech.flac and noise.flac. I would like to mix them in Python. I am not too sure what I have consider to do so. Here some of my thoughts:
-Is the sampling rate in both .flac files important. Do they have to match? -If I want to mix them with a certain SNR, I have to compute first the power of each Signal first and then scale one of the signals so that I have my desired SNR? If that is true, is there any trick to compute the power level, or do you simply compute the integral (integral of the signal^2)?
Thanks for your help