Replies: 4 comments 4 replies
-
Hey, thanks for your suggestions! In future, please try to make one discussion per suggestion or at least a group of related suggestions. That'd make it easier to discuss specifics.
These are good to have features, although not terribly critical. As Bosca provides export to WAV, you can use pretty much any external tool to convert it to any target format, starting with However, this is not a trivial matter. Such formats as MP3 and OGG are complex and require external libraries to implement. WAV is implemented ad hoc because it's trivial and you just store raw data. These other formats require compression and other configuration options, at which point there is no reason to maintain our own implementation. So a library should be used, likely wrapped into a GDExtension. Or alternatively, a path to an external tool could be configured in Bosca, like the aforementioned I'm curious, what's your idea for the implementation? Note: The MP3 feature request is tracked in #29.
I don't think there is a need for that. It's a tool and not a game, and you should be able to jump into it as quickly as possible. We can't avoid having a boot splash while the engine initializes itself, but there is no need to delay the user further with extra animation.
There are no unnecessary or temporary files in the repository right now. Which ones do you think need to be excluded?
That's a fine idea. It's not a big issue right now, as there are only like 2 external contributors in the commit log, but at some point it'd be nice to have an accessible list of everyone involved. Terry used to add people to the credits list in the app itself, and I should probably do that as well, especially now that it's a scrollable popup with unlimited space. |
Beta Was this translation helpful? Give feedback.
-
I have modified the .gitignore file to ignore import files generated by Godot. I recommend recommitting the files without the .import files. |
Beta Was this translation helpful? Give feedback.
-
Hey, I've decided to implement my own library as a Godot addon to support .mp3 and .ogg formats in BoscaCeoil-blue. By creating a Godot addon, we can efficiently integrate the necessary functionalities while managing the complexity. |
Beta Was this translation helpful? Give feedback.
-
Sorry to disturb you again, but here is the final idea to integrate WAV, MP3, and OGG: Detailed Guide to Bundling FFmpeg with BoscaCeoilStep 1: Create a Directory for FFmpeg Binaries
Step 2: Implement GDExtension Code to Use Local FFmpeg Binariesaudio_encoder.h #ifndef AUDIO_ENCODER_H
#define AUDIO_ENCODER_H
#include <Godot.hpp>
#include <RefCounted.hpp>
using namespace godot;
class AudioEncoder : public RefCounted {
GDCLASS(AudioEncoder, RefCounted);
protected:
static void _bind_methods();
public:
AudioEncoder();
~AudioEncoder();
bool encode_audio(String input_path, String output_path, String output_format, Dictionary options);
bool is_ffmpeg_installed();
String get_ffmpeg_path();
};
#endif // AUDIO_ENCODER_H audio_encoder.cpp #include "audio_encoder.h"
#include <cstdlib> // For system() function
using namespace godot;
void AudioEncoder::_bind_methods() {
ClassDB::bind_method(D_METHOD("encode_audio", "input_path", "output_path", "output_format", "options"), &AudioEncoder::encode_audio);
ClassDB::bind_method(D_METHOD("is_ffmpeg_installed"), &AudioEncoder::is_ffmpeg_installed);
ClassDB::bind_method(D_METHOD("get_ffmpeg_path"), &AudioEncoder::get_ffmpeg_path);
}
AudioEncoder::AudioEncoder() {}
AudioEncoder::~AudioEncoder() {}
bool AudioEncoder::is_ffmpeg_installed() {
String cmd = get_ffmpeg_path() + " -version > /dev/null 2>&1";
int result = system(cmd.utf8().get_data());
return result == 0;
}
String AudioEncoder::get_ffmpeg_path() {
#ifdef WINDOWS
return "res://addons/audio_encoder/bin/ffmpeg.exe";
#elif OSX
return "res://addons/audio_encoder/bin/ffmpeg";
#elif LINUX
return "res://addons/audio_encoder/bin/ffmpeg";
#else
return "ffmpeg";
#endif
}
bool AudioEncoder::encode_audio(String input_path, String output_path, String output_format, Dictionary options) {
String codec_options = "";
if (options.has("bitrate")) {
codec_options += String(" -b:a {0}k").format(Array::make(options["bitrate"]));
}
if (options.has("quality")) {
codec_options += String(" -q:a {0}").format(Array::make(options["quality"]));
}
if (options.has("sample_rate")) {
codec_options += String(" -ar {0}").format(Array::make(options["sample_rate"]));
}
// FFmpeg command to encode audio
String cmd = String("{0} -i {1} {2} {3}.{4}").format(Array::make(get_ffmpeg_path(), input_path, codec_options, output_path, output_format));
int result = system(cmd.utf8().get_data());
return result == 0;
} audio_encoder.gdextension
Step 3: Compile the GDExtensionStep 4: Integrate and Use the GDExtension in Godotaudio_encoder.gdns
Example Usageexample_usage.gd extends Node
var _audio_encoder = preload("res://addons/audio_encoder/audio_encoder.gdns").new()
# General function to encode audio
func encode_audio_file(input_path: String, output_path: String, output_format: String, options: Dictionary) -> void:
if not _audio_encoder.is_ffmpeg_installed():
print("FFmpeg is not installed. Please install FFmpeg from https://ffmpeg.org/download.html.")
return
var success = _audio_encoder.encode_audio(input_path, output_path, output_format, options)
if success:
print("Audio successfully encoded to", output_format)
else:
print("Failed to encode audio to", output_format)
# Example usage for CEOL to MP3
func export_ceol_to_mp3():
var input_path = "res://path/to/input.ceol"
var output_path = "res://path/to/output"
var output_format = "mp3"
var options = {
"bitrate": 320, # Maximum bitrate for MP3
"sample_rate": 48000 # High sample rate
}
encode_audio_file(input_path, output_path, output_format, options)
# Example usage for WAV to OGG
func export_wav_to_ogg():
var input_path = "res://path/to/input.wav"
var output_path = "res://path/to/output"
var output_format = "ogg"
var options = {
"quality": 10, # Maximum quality for OGG
"sample_rate": 48000 # High sample rate
}
encode_audio_file(input_path, output_path, output_format, options)
# Example usage for CEOL to WAV
func export_ceol_to_wav():
var input_path = "res://path/to/input.ceol"
var output_path = "res://path/to/output"
var output_format = "wav"
var options = {
"sample_rate": 48000 # High sample rate
}
encode_audio_file(input_path, output_path, output_format, options) Summary
|
Beta Was this translation helpful? Give feedback.
-
Hello yurisizov,
My name is Ray, and I am excited to contribute to the further development of Boscaceoil-blue. Following up on our previous discussion, here are the key areas we will focus on:
Proposed Contributions:
Addition of .ogg Sound Format Exporter
Objective: Extend audio export options by supporting the OGG format.
Plan: Integrate the OGG exporter into the existing export functionality.
Addition of .mp3 Sound Format Exporter
Objective: Provide users with an option to export audio in MP3 format.
Plan: Implement MP3 export functionality using an external library for encoding.
Replacement of the Current Bootsplash with an Animated Boot Splash
Objective: Enhance user experience with a modern, animated boot splash screen.
Plan: Develop a new animation and integrate it into the startup process.
Refinement of the .gitignore File
Maintain a Clean Repository
Purpose: Exclude unnecessary files from the repository.
Impact: Keeps the repository organized and free of clutter, making it easier to navigate and manage.
Improve Efficiency
Purpose: Optimize the repository by ignoring files that do not need version control, such as temporary files or build artifacts.
Impact: Enhances the performance of version control operations like cloning, fetching, and pushing, as only relevant files are tracked.
Introduction of a contributors.txt File
Objective: Acknowledge all contributors and foster community engagement.
Plan: Create and maintain a contributors.txt file to recognize contributions.
Collaboration and Feedback
I look forward to discussing these proposals further and outlining the steps needed to implement them. Your feedback and suggestions are highly valued. Let's collaborate to make Boscaceoil-blue even better
Beta Was this translation helpful? Give feedback.
All reactions