This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename type> char* to_binary(type* obj) { | |
char* binary = static_cast<char*>(malloc(sizeof(*obj) * 8 + (sizeof(*obj) - 1) + 1)); | |
uint64_t idx = 0; | |
for (int64_t i = sizeof(*obj) - 1; i >= 0; i--) { | |
unsigned char byte = *((unsigned char*)(obj) + i); | |
auto* buffer = new char[8]; | |
if (!binary || !buffer) { | |
return new char[1] {'\0'}; | |
} | |
for (int64_t j = 7; j >= 0; j--) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from moviepy.editor import * # Install with "pip install moviepy" command | |
import os | |
for file in [file for file in os.listdir() if os.path.splitext(file)[1] == ".mp4"]: | |
video = VideoFileClip(file) | |
video.audio.write_audiofile(os.path.splitext(file)[0] + ".mp3") |