标签: gfx

android mediaRecorder.setAudioSource失败了

我有android G1固件1.6,我试图用以下代码从应用程序录制语音.

MediaRecorder recorder = new MediaRecorder();
 recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
 recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
 recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
 recorder.setOutputFile(PATH_NAME);
 recorder.prepare();
 recorder.start();  

我的manifest.xml有:

<uses-permission android:name="android.permission.RECORD_AUDIO" />

我有:

09-23 14:41:05.531: ERROR/AndroidRuntime(1718): Uncaught handler: thread main exiting due to uncaught exception
09-23 14:41:05.551: ERROR/AndroidRuntime(1718): java.lang.RuntimeException: setAudioSource failed.
09-23 14:41:05.551: ERROR/AndroidRuntime(1718):     at android.media.MediaRecorder.setAudioSource(Native Method)

我该如何正确录制声音?

android voice media-player gfx

67
推荐指数
5
解决办法
6万
查看次数

如何在pygame中使用gfx

我有一个pygame游戏,我想使用pygame.gfxdraw.aacricle(),但每当我这样做时都会给我一个错误:

AttributeError:'module'对象没有属性'gfxdraw'

如何为python 2.7安装gfx?

python pygame gfx

10
推荐指数
1
解决办法
4104
查看次数

货物,工作空间和临时本地依赖

我在一个货物工作区中有两个项目my_project和my_inner_project。它们都依赖于gfx(以及gfx_core和gfx_device_gl)。我在gfx_device_core中发现了一个错误,因此我已经对其进行了分叉,克隆,本地修补,并希望在提交之前对其进行测试。

项目结构:

-my_project
--my_inner_project
---Cargo.toml
--Cargo.toml
-gfx
--src
---core
----Cargo.toml  #package gfx_core
---backend
----gl
-----Cargo.toml #package gfx_device_gl
---render
----Cargo.toml  #package gfx
--Cargo.toml
Run Code Online (Sandbox Code Playgroud)

现在,我希望货物在my_project构建期间使用gfx的本地副本:

  1. 第一种方法(Cargo.toml中的本地路径):我将所有gfx软件包的源都更改为两个项目的Cargo.tomls中的本地路径。\不幸的是,货物隐含地假设(这对我来说有点疯狂) “路径”所指向的依赖项是工作空间的一部分,但是工作空间成员必须位于文件系统中的工作空间根目录之下。因此它拒绝构建项目,抱怨gfx *是工作空间的一部分,但它不在工作空间根目录下。AFAIK,当前无法更改此隐式“一切都在工作区”行为。
  2. 第二种方法([替换]):这种方法导致与上述相同的行为。[replace]内部指定的路径也隐式添加到工作空间中。
  3. 第三种方法(覆盖本地路径):我在.cargo / config中的路径中添加了gfx。也有必要将我的.tomls中的gfx软件包的源从crate.io更改为git信息库,因为被覆盖的软件包中的版本和.toml中引用的版本必须匹配。这在稳定的锈蚀1.13中也不起作用。我得到警告:

    warning: path override for crate `gfx_device_gl` has altered the original list of dependencies; the dependency on `gfx_core` was either added or modified to not match the previously resolved version
    
    This is currently allowed but is known to produce buggy behavior with spurious recompiles and changes to the crate graph. Path …
    Run Code Online (Sandbox Code Playgroud)

gfx rust rust-cargo

5
推荐指数
1
解决办法
684
查看次数

如何将顶点缓冲区绑定到Gfx-rs中的统一数组?

我正在尝试Uniform使用gfx-rs 将s 的列表传递给顶点着色器。数据定义如下

gfx_defines! {
    vertex Vertex { ... }

    constant MyConst {
        valoo: i32 = "my_val",
    }

    pipeline pipe {
        my_const: gfx::ConstantBuffer<MyConst> = "my_const",
        vbuf: gfx::VertexBuffer<Vertex> = (),
        out: gfx::RenderTarget<ColorFormat> = "Target0",
    }
}
Run Code Online (Sandbox Code Playgroud)

顶点着色器如下:

#version 150 core

struct MyConst
{
    uint my_val;
};

in vec2 a_Pos;
in vec3 a_Color;
uniform MyConst my_const[];
out vec4 v_Color;

void main() {
    MyConst cc = my_const[0];
    v_Color = vec4(a_Color, 1.0);
    gl_Position = vec4(a_Pos, 0.0, 1.0);
}
Run Code Online (Sandbox Code Playgroud)

当我在中引入第一行时main(),应用程序因错误而崩溃:

gfx_defines! …
Run Code Online (Sandbox Code Playgroud)

opengl glsl gfx rust

5
推荐指数
1
解决办法
134
查看次数

标签 统计

gfx ×4

rust ×2

android ×1

glsl ×1

media-player ×1

opengl ×1

pygame ×1

python ×1

rust-cargo ×1

voice ×1