我有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)
我该如何正确录制声音?
我有一个pygame游戏,我想使用pygame.gfxdraw.aacricle(),但每当我这样做时都会给我一个错误:
AttributeError:'module'对象没有属性'gfxdraw'
如何为python 2.7安装gfx?
我在一个货物工作区中有两个项目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的本地副本:
第三种方法(覆盖本地路径):我在.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)我正在尝试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) gfx ×4
rust ×2
android ×1
glsl ×1
media-player ×1
opengl ×1
pygame ×1
python ×1
rust-cargo ×1
voice ×1