carykh / recordtrimedit Goto Github PK
View Code? Open in Web Editor NEWRecords audio, trims it, and allows you to edit it, all in one fell swoop.
License: MIT License
Records audio, trims it, and allows you to edit it, all in one fell swoop.
License: MIT License
Allowing command option flags for greater portability and/or scanning directories like $HOME/.config/recordEditTrim
would allow the script to be installed in a standard binary directory without having to configure it in that directory, which is considered bad practice.
Frankly, the easier option for both implementation and usage would be CLI flags.
This issue is mentioned in #16:
On Windows, the following error may occur:
ValueError: cannot reshape array of size 1764 into shape (882,)
This can happen in two places: line 162, where the expected size of the array from the sound buffer is hardcoded as
audio_array.reshape((882))
as well as line 316, where the audio is combined into a single array:
audio_full[i*chunk_size:i*chunk_size+chunk_size] = np.frombuffer(sound_chunks[i], dtype=np.int16)
The reason this occurs is because on Windows, with allowed_changes=AUDIO_ALLOW_FORMAT_CHANGE
in the audio device, the size of the chunks may change (in my case as with #16, it is double, from 882 to 1764).
Simply disabling this option (i.e. setting allowed_changes=0
) causes the program to continue working in my WSL environment as well as to work properly on Windows. A more involved solution would be to allow audio format changes and then, instead of using the values of SAMPLE_RATE
and CHUNK_RATE
from the config file to determine the size of the chunks (used in both places above), to retrieve these values from the audio device after it is initalized.
First:
line 230, in drawWaveforms(screen)
line 128, in drawWaveforms
audio_array = audio_array.reshape((882))
ValueError: cannot reshape array of size 1764 into shape (882,)
I changed the number to 1764 and the program seemed to work, but the audio input was white noise (the waveform was just a black wall)
Running on Windows 10 x86-64, Python 3.12.2
Opening a new issue because they're 2 different problems it seems
Running on Windows
Traceback (most recent call last):
File "C:\Users\Pawlakov\Desktop\Informatyka\Repozytoria\recordTrimEdit\recordTrimEdit.py", line 303, in
drawWaveforms(screen)
File "C:\Users\Pawlakov\Desktop\Informatyka\Repozytoria\recordTrimEdit\recordTrimEdit.py", line 162, in drawWaveforms
audio_array.reshape((882))
ValueError: cannot reshape array of size 1764 into shape (882,)
So I ran the code, and it said invalid syntax
I downloaded python and pygame, but it still doesn't work...
When saving the file, the following error is produced
File "/mnt/c/Users/musa/_Local/GitHub/recordTrimEdit/recordTrimEdit.py", line 312, in <module>
FULL_LEN = len(sound_chunks)*CHUNK_SIZE
^^^^^^^^^^
NameError: name 'CHUNK_SIZE' is not defined
This can be fixed by defining a CHUNK_SIZE for use in lines 312-315, such as:
CHUNK_SIZE = default_sample_rate//default_chunk_rate
This value seems to have been removed in the PR #8, and I expect this is not the intended fix based on that PR.
Issue with the script, line 61, in
devicename=names[mic_index],
~~~~~^^^^^^^^^^^
IndexError: list index out of range
Running using python 3.12.2
This project does not seem to have a license declared in an obvious way, or at all. A license should be added (as this project seems to be intended as open source) so that users can run, modify, study, distribute, and use the code.
literally just wont run
heres what pops up
D:\github\recordTrimEdit>python recordTrimEdit.py
pygame 2.5.2 (SDL 2.28.3, Python 3.10.4)
Hello from the pygame community. https://www.pygame.org/contribute.html
KeyError: 0
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\github\recordTrimEdit\recordTrimEdit.py", line 188, in
for event in pg.event.get():
SystemError: returned a result with an exception set
OS: Arch linux
pygame 2.4.0 (SDL 2.30.0, Python 3.11.7).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.