Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Ragbot

Pages: [1]
1
I was trying out MAGIX and after getting bored I left it open in the background then went and started testing my project which was supposed to play some audio but it started printing out this error

Quote
AL lib: (EE) ALCmmdevPlayback_resetProxy: Failed to initialize audio client: 0x8889000a
Failed to create the audio context

and after I closed MAGIX...
It started playing it properly so is this a bug or is there some way I can fix this? :-[

also, it works fine with other apps like chrome and windows media player

2
General / Unable to use RSFML
« on: June 01, 2021, 03:17:57 pm »
I try compiling but it keeps giving me this linker error.

Quote
error: linking with `x86_64-w64-mingw32-gcc` failed: exit code: 1
  |
  = note: "x86_64-w64-mingw32-gcc" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-Wl,--dynamicbase" "-Wl,--di
sable-auto-image-base" "-m64" "-Wl,--high-entropy-va" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_6
4-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsbegin.o" "-L" "C:\\Users\\shale\\.rustup\\to
olchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "D:\\tmp\\source\\rs\\ri
mg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.0.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\tar
get\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.1.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\de
bug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.10.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\d
eps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.11.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\r
img-ad2a4556e79d2940.rimg.20lb8wv2-cgu.12.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad
2a4556e79d2940.rimg.20lb8wv2-cgu.13.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556
e79d2940.rimg.20lb8wv2-cgu.14.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d29
40.rimg.20lb8wv2-cgu.15.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rim
g.20lb8wv2-cgu.2.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8
wv2-cgu.3.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu
.4.rcgu.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.5.rcgu
.o" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.6.rcgu.o" "D:
\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.7.rcgu.o" "D:\\tmp\\
source\\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.8.rcgu.o" "D:\\tmp\\source\
\rs\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.rimg.20lb8wv2-cgu.9.rcgu.o" "-o" "D:\\tmp\\source\\r
s\\rimg\\target\\debug\\deps\\rimg-ad2a4556e79d2940.exe" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\
rimg-ad2a4556e79d2940.4yd7dkx4mepq9kek.rcgu.o" "-Wl,--gc-sections" "-nodefaultlibs" "-L" "D:\\tmp\\source\
\rs\\rimg\\target\\debug\\deps" "-L" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\
\lib\\rustlib\\x86_64-pc-windows-gnu\\lib" "-Wl,-Bstatic" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\
\libsfml-b9afb2dd96dce8b0.rlib" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\libbitflags-84f5a0c0a040c
b29.rlib" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\libonce_cell-50563e1b480243e9.rlib" "D:\\tmp\\s
ource\\rs\\rimg\\target\\debug\\deps\\libwidestring-5382785c179206ec.rlib" "D:\\tmp\\source\\rs\\rimg\\tar
get\\debug\\deps\\libcsfml_graphics_sys-2e5f9fc9ee526da7.rlib" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\
deps\\libcsfml_window_sys-9bfd16c96170dff1.rlib" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\libcsfml
_audio_sys-be74682fdca4ff3a.rlib" "D:\\tmp\\source\\rs\\rimg\\target\\debug\\deps\\libcsfml_system_sys-c21
ace4f867a3dbe.rlib" "-Wl,--start-group" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-g
nu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libstd-5c720e8db4b99e37.rlib" "C:\\Users\\shale\\.rustup\\to
olchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libpanic_unwind-29283164
da786e03.rlib" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-
pc-windows-gnu\\lib\\libobject-1776be3a32adbb49.rlib" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_6
4-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libaddr2line-0892c1b32ffa2c4d.rlib" "C:\\Users
\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libg
imli-517a95b0a57b9e8e.rlib" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rus
tlib\\x86_64-pc-windows-gnu\\lib\\librustc_demangle-82d48d88ac13ce1c.rlib" "C:\\Users\\shale\\.rustup\\too
lchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libhashbrown-37de12e440fa
77bc.rlib" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-w
indows-gnu\\lib\\librustc_std_workspace_alloc-7549ba16005c4b88.rlib" "C:\\Users\\shale\\.rustup\\toolchain
s\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libunwind-b131f4022158fa79.rlib
" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gn
u\\lib\\libcfg_if-bfa5ff0422f13358.rlib" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-
gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liblibc-454b6cdb3888a4db.rlib" "C:\\Users\\shale\\.rustup\\
toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\liballoc-90ee5fe37d110
9a4.rlib" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-wi
ndows-gnu\\lib\\librustc_std_workspace_core-f5802464b35b87c4.rlib" "C:\\Users\\shale\\.rustup\\toolchains\
\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\libcore-7ca46f1af2cdfb26.rlib" "-
Wl,--end-group" "C:\\Users\\shale\\.rustup\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64
-pc-windows-gnu\\lib\\libcompiler_builtins-13d041c714b5c5f4.rlib" "-Wl,-Bdynamic" "-lcsfml-graphics" "-lcs
fml-window" "-lcsfml-audio" "-lcsfml-system" "-ladvapi32" "-lws2_32" "-luserenv" "-lgcc_eh" "-l:libpthread
.a" "-lmsvcrt" "-lmingwex" "-lmingw32" "-lgcc" "-lmsvcrt" "-luser32" "-lkernel32" "C:\\Users\\shale\\.rust
up\\toolchains\\stable-x86_64-pc-windows-gnu\\lib\\rustlib\\x86_64-pc-windows-gnu\\lib\\rsend.o"
  = note: D:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.2.0/../../../../x86_64-w64-mingw32/bin/ld
.exe: D:\tmp\source\rs\rimg\target\debug\deps\libsfml-b9afb2dd96dce8b0.rlib(sfml-b9afb2dd96dce8b0.sfml.5zo
luu9r-cgu.11.rcgu.o): in function `sfml::graphics::render_texture::RenderTexture::with_settings':
          C:\Users\shale\.cargo\registry\src\github.com-1ecc6299db9ec823\sfml-0.16.0\src\graphics/render_t
exture.rs:57: undefined reference to `sfRenderTexture_createWithSettings'
          collect2.exe: error: ld returned 1 exit status


error: aborting due to previous error

error: could not compile `rimg`

Windows 10
Gnu Tool Chain
Rust 1.52.1

3
Like when we have the data stored in a char[] or std::string?

and is the same possible for sf::Music with .wav and .ogg files?

I tried this.... but...
I kinda regret it now...

That was hell...

#include <iostream>
#include <fstream>
#include <ios>
#include <SFML/Audio.hpp>


int main()
{
        std::string str = "";
        std::string file = "";
        std::ifstream fileStream("audio.wav", std::ios::binary);
        while(getline(fileStream, str))
        {
                file += str;
        }

        sf::Music audio;
        audio.openFromMemory(file.data(), file.length());
        audio.play();

        while(audio.getStatus() != sf::SoundSource::Stopped){}


        return 0;
}
 

4
General / Get Keyboard input without a window(Console)
« on: May 09, 2021, 09:02:11 pm »
I cant get user input without a window,

because I have to use

while(window.pollEvent(event))
{
    switch(event.type)
    {}
}
 

So, is there any way for me too get user input without a window?

5
System / sf::Thread error
« on: May 04, 2021, 02:09:32 pm »
I added a new thread to my code and I keep getting this error...

D:\tmp\source\cp\audio_GUI\src\Mp3.cpp:214:12: warning: deleting 'void*' is undefined [-Wdelete-incomplete]
  214 |     delete rawMp3Data;
      |            ^~~~~~~~~~
In file included from D:\tmp\source\cp\audio_GUI\include/SFML/System/Thread.hpp:193,
                 from D:\tmp\source\cp\audio_GUI\include/SFML/System.hpp:43,
                 from D:\tmp\source\cp\audio_GUI\include/SFML/Window.hpp:32,
                 from D:\tmp\source\cp\audio_GUI\include/App/window.hpp:4,
                 from D:\tmp\source\cp\audio_GUI\src\window.cpp:1:
D:\tmp\source\cp\audio_GUI\include/SFML/System/Thread.inl: In instantiation of 'void sf::priv::ThreadFunctor<T>::run() [with T = void (au::Window::*)()]':
D:\tmp\source\cp\audio_GUI\include/SFML/System/Thread.inl:39:18:   required from here
D:\tmp\source\cp\audio_GUI\include/SFML/System/Thread.inl:39:34: error: must use '.*' or '->*' to call pointer-to-member function in '((sf::priv::ThreadFunctor<void (au::Window::*)()>*)this)->sf::priv::ThreadFunctor<void (au::Window::*)()>::m_functor (...)', e.g. '(... ->* ((sf::priv::ThreadFunctor<void (au::Window::*)()>*)this)->sf::priv::ThreadFunctor<void (au::Window::*)()>::m_functor) (...)'
   39 |     virtual void run() {m_functor();}
      |                         ~~~~~~~~~^~

Build finished with error(s).
The terminal process terminated with exit code: -1.
 

This is my code :

void au::Window::loop()
{
    sf::Thread thread_new(&mouse_pos_loop);
    thread_new.launch();

    while(r_window.isOpen())
    {
        render();
        event_handler();
       
    }
}
 

6
So I was trying to implement mp3 support to my audio player and I tried HeinC's mp3 reader from the SMFL Wiki: https://github.com/SFML/SFML/wiki/Source%3A-Mp3-Soundfile-Reader



But it spits this out and exits by itself.

Quote
START: C:/Users/shale/Music/Airpod_Shotty.mp3
CHECK: can Mp3 Reader handle the stream?
created handle at address 14352496
opened handle for feeding
first header decoded
buffersize: 2048
total bytes read: 2048
total bytes decoded: 0
reads from stream: 1
CHECK: SUCCESS
Mp3 reader close
OPEN
created handle at address 14352496
opened handle for feeding
first header decoded
buffersize: 2048
total bytes read: 2048
total bytes decoded: 0
reads from stream: 1
format: sample rate in Hz: 44100
format: channels: 2
format: encoding: 208
header: MPEG version: 1.0
header: MPEG Audio mode: Joint Stereo (2 channels)
header: Mode type of variable bitrate (vbr): Variable Bitrate Mode
header: MPEG Audio Layer (MP1/MP2/MP3): 3
header: Mode extension bit flag: 2
header: Emphasis type (?): 0
header: Target average bitrate: 0
header: Bitrate of the frame (kbps): 192
header: Sampling rate in Hz: 44100
header: Size of the frame (in bytes, including header): 626
wrote info: channels: 2, expected number of samples: 311, sampling rate: 44100
OPEN: SUCCESS
Resource not found
READ: request up to 88200 samples. size of streambuffer: 80000 bytes
decoded 4796 bytes from leftover input. offset into samples: 4796 / 176400
read 80000 bytes from stream
decoded 80000 to 171604 decoded bytes. total decoded bytes: 176400 / 176400
samples delivered: 88200 of 88200 requested
total bytes read: 80000
READ: SUCCESS
SEEK sample offset 0 FIXME not implemented
Mp3 reader close

this is my main.cpp

Quote
#include "SoundFileReaderMp3.hpp"
#include <SFML/Audio.hpp>

#include <iostream>
#include <string>

int main(int argc, const char* argv[]) {
   
   if(argc == 1) {
      std::cout << ": missing argument <absolute filename>" << std::endl;
      return -1;
   }

   std::string filename(argv[1]);

   std::cout << "START: " << filename << std::endl;
   
   sf::SoundFileFactory::registerReader<audio::SoundFileReaderMp3>();

   sf::Music music;

   if (!music.openFromFile(filename)) {
      std::cout << "check your file path. also only wav, flac, ogg and mp3 are supported." << std::endl;
      return -1;
   }

   music.play();

   while(music.getStatus() != sf::SoundSource::Status::Stopped)
   {}

   return 0;
}

Pages: [1]